setHandler() public method

You can pass: * An object with handler methods. * A callable that receives a {@link Command} and returns an object with handler methods. The name of the executed handler method can be configured with {@link setHandlerMethod()}. By default, the method handle() is executed.
See also: getHandler()
public setHandler ( object | callback $handler ) : ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig
$handler object | callback The command handler or the callable creating a new command handler on demand.
return ApplicationConfig | CommandConfig | SubCommandConfig | OptionCommandConfig The current instance.
Example #1
0
 /**
  * @expectedException \InvalidArgumentException
  */
 public function testSetHandlerFailsIfNeitherObjectNorCallable()
 {
     $this->config->setHandler(1234);
 }