Ejemplo n.º 1
0
 /**
  * @return array
  */
 public function getParams($path = null, $default = null)
 {
     if (null !== $path) {
         return ArrayUtils::get($this->params, $path, $default);
     }
     return $this->params;
 }
Ejemplo n.º 2
0
 public function getParams($path = null, $default = null)
 {
     if (null === $this->params) {
         $this->params = $this->getParentCommand()->getParams();
     }
     if (null === $path) {
         return $this->params;
     } else {
         return ArrayUtils::get($this->params, $path, $default);
     }
 }
Ejemplo n.º 3
0
 /**
  * @param CommandInterface $command
  * @return WorkerInterface[]
  */
 public function getCommandWorkers(CommandInterface $command)
 {
     $class = (string) $command->getClass();
     $action = $command->getName();
     do {
         if (false === $class) {
             $class = "";
         }
         $path = [$action, $class];
         if (ArrayUtils::issetByPath($this->actionMap, $path)) {
             $workers = ArrayUtils::get($this->actionMap, $path);
             $workers = ArrayUtils::sortByKey($workers);
             //may be cache like: $this->actionMap = ArrayUtils::set($this->actionMap, $path, $workers);
             foreach ($workers as $worker) {
                 (yield $this->getWorker($worker["name"]));
             }
         }
         if ("" !== $class) {
             $class = get_parent_class($class);
         }
     } while ("" !== $class);
 }