Ejemplo n.º 1
0
 /**
  * Applies the specified prefix to all the arguments but the last one.
  *
  * @param ICommand $command Command instance.
  * @param string $prefix Prefix string.
  */
 public static function skipLast(ICommand $command, $prefix)
 {
     $arguments = $command->getArguments();
     $length = count($arguments);
     for ($i = 0; $i < $length - 1; $i++) {
         $arguments[$i] = "{$prefix}{$arguments[$i]}";
     }
     $command->setRawArguments($arguments);
 }
Ejemplo n.º 2
0
 public function addCommand(ICommand $callback)
 {
     $this->queue[] = $callback;
     $callback->attach($this);
 }