Example #1
0
 private function doHandle(Args $args, IO $io)
 {
     if ($this->dispatcher && $this->dispatcher->hasListeners(ConsoleEvents::PRE_HANDLE)) {
         $event = new PreHandleEvent($args, $io, $this);
         $this->dispatcher->dispatch(ConsoleEvents::PRE_HANDLE, $event);
         if ($event->isHandled()) {
             return $event->getStatusCode();
         }
     }
     $commandHandler = $this->config->getHandler();
     $handlerMethod = $this->config->getHandlerMethod();
     return $commandHandler->{$handlerMethod}($args, $io, $this);
 }
Example #2
0
 public function testGetHandlerReturnsApplicationHandlerByDefault()
 {
     $handler = new NullHandler();
     $this->applicationConfig->setHandler($handler);
     $this->assertSame($handler, $this->config->getHandler());
 }