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

setHandlerMethod() public method

The method receives three arguments: * {@link Args} $args: The console arguments. * {@link IO} $io: The I/O. * {@link Command} $command: The executed command.
See also: getHandlerMethod()
public setHandlerMethod ( string $handlerMethod ) : ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig
$handlerMethod string The method name.
return ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig The current instance.
    public function setHandlerMethod($handlerMethod)
    {
        Assert::string($handlerMethod, 'The handler method must be a string. Got: %s');
        Assert::notEmpty($handlerMethod, 'The handler method must not be empty.');
        $this->handlerMethod = $handlerMethod;
        return $this;
    }

Usage Example

Example #1
0
 /**
  * @expectedException \InvalidArgumentException
  */
 public function testSetHandlerMethodFailsIfNoString()
 {
     $this->config->setHandlerMethod(1234);
 }