public function __construct($execution = null, $name = null) { if (!is_null($execution) && $execution instanceof Runnable) { $this->runnable = $execution; } elseif (!is_null($execution) && is_callable($execution)) { $this->runnable = $execution; } elseif (!is_null($execution)) { throw new \InvalidArgumentException('param execution is not a object of Runnable or callable'); } else { Utils::checkOverwriteRunMethod(get_class($this)); } if (!is_null($name)) { $this->name = $name; } $this->initStatus(); }
/** * @param ReaderInterface $reader * @param FilterInterface $filter * @param NotificationInterface $notify */ public function __construct(ReaderInterface $reader, FilterInterface $filter, NotificationInterface $notify) { parent::__construct(); $this->reader = $reader; $this->filter = $filter; $this->notify = $notify; $this->registerSignalHandler(SIGTERM, array($this, 'signalHandler')); }