/** * @return AbstractAction */ public function getAction($actionClass) { return $this->container->asSingleton(__METHOD__ . $actionClass, function (ApplicationFactory $appFactory) use($actionClass) { $action = new $actionClass($appFactory->getConfig()); return $action; }); }
/** * @param $type * @return HandlerInterface */ public function getHandler($type) { return $this->container->asSingleton(__METHOD__ . $type, function (ApplicationFactory $appFactory, ActionFactory $actionFactory) use($type) { switch ($type) { case Handler\ScannedDocuments::class: return new Handler\ScannedDocuments($appFactory->getConfig(), $actionFactory); case Handler\DirectoryHandler::class: return new Handler\DirectoryHandler($appFactory->getConfig(), $actionFactory); default: throw new InvalidArgumentException('Invalid FileHandler: ' . $type); } }); }
/** * @return \Lexsign\Services\HomeAutomation\Vendor\YouLess\Youless\\Lexsign\Services\HomeAutomation\Vendor\YouLess\YouLess */ public function getYouLess() { return $this->container->asSingleton(__METHOD__, function () { return new YouLess(); }); }