示例#1
0
 /**
  * @return AbstractAction
  */
 public function getAction($actionClass)
 {
     return $this->container->asSingleton(__METHOD__ . $actionClass, function (ApplicationFactory $appFactory) use($actionClass) {
         $action = new $actionClass($appFactory->getConfig());
         return $action;
     });
 }
示例#2
0
 /**
  * @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);
         }
     });
 }
示例#3
0
 /**
  * @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();
     });
 }