Can be used to represent a single command: class MyCommand extends Command { public function execute(array $args, array $options = array()) { $this->writeln('hello world'); } } If "execute()" is not overriden, the execution will be forwarded to subcommand methods. The subcommand name will be the first argument value and the associated method must be prefixed with "execute". class MyCommand extends Command { public function executeSub1(array $args, array $options = array()) { $this->writeln('hello world'); } public function executeSub2(array $args, array $options = array()) { $this->writeln('hello world'); } }
Esempio n. 1
0
 public function execute(array $args, array $options = array())
 {
     if (isset($options['verbose'])) {
         $this->verbose = isset($options['verbose']);
     }
     return parent::execute($args, $options);
 }