public function setDelegate($callable) { if (is_callable($callable)) { $this->callback = $callable; } else { throw new \Exception('passed argument is not callable'); } }