예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function factory($name, array $args = array())
 {
     if ($this->description->hasCommand($name)) {
         $command = $this->description->getCommand($name);
         $class = $command->getConcreteClass();
         return new $class($args, $command);
     }
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function factory($name, array $args = array())
 {
     $command = $this->description->getCommand($name);
     // If an inflector was passed, then attempt to get the command using
     // snake_case inflection
     if (!$command && $this->inflector) {
         $command = $this->description->getCommand($this->inflector->snake($name));
     }
     if ($command) {
         $class = $command->getConcreteClass();
         return new $class($args, $command);
     }
 }