nia / routing-facade-cli
CLI routing facade to simply add CLI routes to a given router.
This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.
Installs: 309
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/nia/routing-facade-cli
Requires
- php: >=7.0.0
- nia/requestresponse-cli: *
- nia/routing: *
This package is not auto-updated.
Last update: 2022-03-03 23:25:58 UTC
README
CLI routing facade to simply add CLI routes to a given router.
Installation
Require this package with Composer.
composer require nia/routing-facade-cli
Tests
To run the unit test use the following command:
$ cd /path/to/nia/component/
$ phpunit --bootstrap=vendor/autoload.php tests/
How to use
The following sample shows you how to use the CLI routing facade component for a common use case.
$router = new Router(); // encapsulate the router into the facade. $facade = new CliFacade($router); // routes with additional conditions and filters. // e.g.: bin/cli --update-inventory $facade->cli($updateInventoryHandler, new ArgumentCondition('update-inventory'), $myFilters); // cli fallback. // e.g.: bin/cli $facade->cli($showHelpHandler);