Webmozart\Console\Api\Config\Config::getHandler PHP Method

getHandler() public method

Returns the command handler to execute when a command is run.
See also: setHandler()
public getHandler ( ) : object
return object The command handler.
    public function getHandler()
    {
        if (!$this->handler) {
            return $this->getDefaultHandler();
        }
        if (is_callable($this->handler)) {
            $this->handler = call_user_func($this->handler);
        }
        return $this->handler;
    }

Usage Example

Example #1
0
 public function testDefaultHandler()
 {
     $this->assertEquals(new NullHandler(), $this->config->getHandler());
 }