Example #1
0
 /**
  * Add a command by it's name
  *
  * @param   string  $method Method name
  * @param   array   $args   Array containing all the arguments for the original call
  * @return mixed
  * @see addCommand()
  */
 public function __call($method, $args)
 {
     $parts = StringInflector::explode($method);
     if ($parts[0] == 'add' && isset($parts[1])) {
         $config = isset($args[0]) ? $args[0] : array();
         $command = $this->addCommand(strtolower($parts[1]), $config);
         return $command;
     }
     return parent::__call($method, $args);
 }