pop()) { if($this->callBefore) { $callback = $this->callBefore; $callback($model); } $job = new Manager($model); $job->fire(); if($this->callAfter) { $callback = $this->callAfter; $callback($model); } } } /** * @param $callable * @throws \Exception */ public function setCallBefore($callable) { if (!is_callable($callable)) { throw new \Exception('Argument is not callable'); } $this->callBefore = $callable; } /** * @param $callable * @throws \Exception */ public function setCallAfter($callable) { if (!is_callable($callable)) { throw new \Exception('Argument is not callable'); } $this->callAfter = $callable; } }