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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,25 @@ arguments:
- The `ZF\Console\Route` instance that matched
- The `Zend\Console` adapter currently in use

You may create the callable by implementing `ZF\Console\HandlerInterface`, which defines the following method:

namespace ZF\Console;

use Zend\Console\Adapter\AdapterInterface;

interface HandlerInterface
{

/**
* Invokable for Zf/Console Route handler
*
* @param Route $route
* @param AdapterInterface $console
*/

public function __invoke(Route $route, AdapterInterface $console);
}

In most cases, you will use the `Route` instance to gather arguments passed to the application, and
the `Console` instance to provide any feedback or to prompt for any additional information.

Expand Down
22 changes: 22 additions & 0 deletions src/HandlerInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
namespace ZF\Console;

use Zend\Console\Adapter\AdapterInterface;

/**
* @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
* @copyright Copyright (c) 2014 Zend Technologies USA Inc. (http://www.zend.com)
*/

interface HandlerInterface
{

/**
* Invokable for Zf/Console Route handler
*
* @param Route $route
* @param AdapterInterface $console
*/

public function __invoke(Route $route, AdapterInterface $console);
}