public function selectHandler($handler)
    {
        if (!is_callable($handler)) {
            Assert::string($handler, 'The selected handler must be a callable or a string. Got: %s');

            if (!isset($this->handlers[$handler])) {
                throw new InvalidArgumentException(sprintf(
                    'The handler "%s" does not exist.',
                    $handler
                ));
            }
        }

        $this->selectedHandler = $handler;
    }
public function selectHandler($handler)
    {
        if (!is_callable($handler)) {
            Assert::string($handler, 'The selected handler must be a callable or a string. Got: %s');

            if (!isset($this->handlers[$handler])) {
                throw new InvalidArgumentException(sprintf(
                    'The handler "%s" does not exist.',
                    $handler
                ));
            }
        }

        $this->selectedHandler = $handler;
    }
public function selectHandler ( $ handler ) { if ( ! is_callable ( $ handler ) ) { Assert :: string ( $ handler , 'The selected handler must be a callable or a string. Got: %s' ) ; if ( ! isset ( $ this -> handlers [ $ handler ] ) ) { throw new InvalidArgumentException ( sprintf ( 'The handler "%s" does not exist.' , $ handler ) ) ; } } $ this -> selectedHandler = $ handler ; }
Selects the executed handler.

@param string|callback $handler The name of the handler or a callback
that returns the name. The callback
receives the executed {@link Command},
the {@link Args} and the {@link IO} as
arguments.
Selects the executed handler .