zfcampus/zf-console — pull request #7 by weierophinney (2014-07-15 18:15:34+00:00)
Title: Allow setting handler in route configuration

If the handler for a given command can be expressed as a string or array callable (e.g., a function name, a static method name, a class name of a class that is invokable), we should allow specifying the handler as part of the route configuration, in order to keep the associations in one place.

```php
return array(
array(
'name' => 'build',
'route' => ' [--target=]`,
'handler' => 'ZF\Deploy\Deploy`,
),
);
```

`Application`'s constructor would need to be altered to allow the following:

- The `Dispatcher` argument could become optional; if none is provided, one would be created.

- If the routing is provided as configuration, each route that also defines a handler would be mapped to the Dispatcher using that handler _if_ a handler is not already set for the command.