Exemple #1
0
 /**
  * Register a Closure based command with the application.
  *
  * @param string   $signature
  * @param \Closure $callback
  *
  * @return \Viserio\Console\Command\ClosureCommand
  */
 public function command(string $signature, Closure $callback)
 {
     $command = new ClosureCommand($signature, $callback);
     Cerebro::starting(function ($console) use($command) {
         $console->add($command);
     });
     return $command;
 }