From c6dfca59692d48c0a09527991804a5592cad3add Mon Sep 17 00:00:00 2001 From: Eric Richer Date: Thu, 14 Nov 2019 19:46:34 -0500 Subject: [PATCH 1/3] Adding HandlerInterface --- src/HandlerInterface.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/HandlerInterface.php diff --git a/src/HandlerInterface.php b/src/HandlerInterface.php new file mode 100644 index 0000000..8e2c335 --- /dev/null +++ b/src/HandlerInterface.php @@ -0,0 +1,23 @@ + Date: Fri, 15 Nov 2019 12:20:35 -0500 Subject: [PATCH 2/3] Fixed formatting. Updated Dispatcher callables section of README.MD --- README.md | 19 +++++++++++++++++++ src/HandlerInterface.php | 8 ++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3b399e5..4f62e5c 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/src/HandlerInterface.php b/src/HandlerInterface.php index 8e2c335..a91ec70 100644 --- a/src/HandlerInterface.php +++ b/src/HandlerInterface.php @@ -10,14 +10,14 @@ interface HandlerInterface { - + /** * Invokable for Zf/Console Route handler - * + * * @param Route $route * @param AdapterInterface $console */ - - public function __invoke( Route $route, AdapterInterface $console); + + public function __invoke(Route $route, AdapterInterface $console); } From 9d891ffc140363e1be6b4638dfbb2142f8139a6b Mon Sep 17 00:00:00 2001 From: Eric Richer Date: Fri, 15 Nov 2019 12:25:48 -0500 Subject: [PATCH 3/3] Fixed formatting issue. --- src/HandlerInterface.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/HandlerInterface.php b/src/HandlerInterface.php index a91ec70..09c4b30 100644 --- a/src/HandlerInterface.php +++ b/src/HandlerInterface.php @@ -20,4 +20,3 @@ interface HandlerInterface public function __invoke(Route $route, AdapterInterface $console); } -