Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

Adding a HandlerInterface definition. #48

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

visto9259
Copy link

This is simply to add an interface definition to faciliate the creation of route handlers.

I have been using this for a while now and works fine in editor like phpStorm and Zend Studio. The editors will add the __invoke( Route $route, AdapterInterface $console) automatically.

It also helps enforce the proper function definition.

Usage:

use Zend\Console\Adapter\AdapterInterface;
use ZF\Console\HandlerInterface;
use ZF\Console\Route;

class MyHandler implements HandlerInterface
{

/**
 * Invokable for Zf/Console Route handler
 *
 * @param Route $route
 * @param AdapterInterface $console
 */
public function __invoke(Route $route, AdapterInterface $console)
{
    ...
}

}

@weierophinney
Copy link
Member

Please run composer cs-fix, and then commit the results - that's the only failing issue currently.

Also, please add some information to the README.md file regarding the interface, so users know about it.

Thanks!

@visto9259
Copy link
Author

First time submitting a pull request on a public package and obviously first time for zfcampus packages.
I thought it had gone through travis without issues.
Let me fix it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants