Beispiel #1
0
 /**
  * Add a command callback
  *
  * If the handler has already been added. It will not be re-added but parameters will be merged. This allows to
  * change or add parameters for existing handlers.
  *
  * @param  	string          $command  The command name to register the handler for
  * @param 	string|\Closure  $method   The name of the method or a Closure object
  * @param   array|object    $params   An associative array of config parameters or a ObjectConfig object
  * @throws  \InvalidArgumentException If the method does not exist
  * @return  CommandMixin
  */
 public function addCommandCallback($command, $method, $params = array())
 {
     if (is_string($method) && !method_exists($this->getMixer(), $method)) {
         throw new \InvalidArgumentException('Method does not exist ' . get_class() . '::' . $method);
     }
     return parent::addCommandCallback($command, $method, $params);
 }
Beispiel #2
0
 /**
  * Add a command callback
  *
  * If the handler has already been added. It will not be re-added but parameters will be merged. This allows to
  * change or add parameters for existing handlers.
  *
  * @param   string          $command  The command name to register the handler for
  * @param   string|Closure  $method   The name of the method or a Closure object
  * @param   array|object    $params   An associative array of config parameters or a ObjectConfig object
  * @throws  \InvalidArgumentException If the method does not exist
  * @return  CommandHandlerAbstract
  */
 public function addCommandCallback($command, $method, $params = array())
 {
     if (is_string($method) && !is_callable(array($this, $method))) {
         throw new \InvalidArgumentException('Method does not exist ' . __CLASS__ . '::' . $method);
     }
     return parent::addCommandCallback($command, $method, $params);
 }