callable = \Closure::fromCallable($callable); $this->enabled = true; } public function __invoke(): mixed { if ($this->enabled === false) { return false; } return ($this->callable)(); } public function disable() { $this->enabled = false; } public function enable() { $this->enabled = true; } }