/** * @return array */ public function getParams($path = null, $default = null) { if (null !== $path) { return ArrayUtils::get($this->params, $path, $default); } return $this->params; }
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); } }
/** * @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); }