componentClass = $componentClass; $this->method = $method; $this->arguments = $arguments; $this->callback = $callback; } /** * Receives the result after being invoked. Used to save the result and send back with callable if configured. * * @param $result */ public function invoke($result) { $this->return = $result; $this->invoked = true; if (is_callable($this->callback)) call_user_func($this->callback, $result); } public function isInvoked(): bool { return $this->invoked; } public function getResult() { if ($this->invoked == true) return $this->return; else return false; } }