mirror of
https://github.com/Dannecron/test-php8-attributes.git
synced 2025-12-25 21:32:35 +03:00
Run cached and simple services in one command.
This commit is contained in:
5
cli.php
5
cli.php
@@ -7,9 +7,12 @@ $jokeGuzzle = new \GuzzleHttp\Client([
|
||||
]);
|
||||
|
||||
$cache = new \Sarahman\SimpleCache\FileSystemCache(__DIR__ . '/tmp/cache');
|
||||
|
||||
$jokeService = new \App\Service\JokeService($jokeGuzzle);
|
||||
$jokeCacheService = new \App\Service\JokeCachedService($jokeGuzzle);
|
||||
$jokeOperation = new \App\Operation\JokeOperation($jokeService, $cache);
|
||||
$jokeOperationWithCache = new \App\Operation\JokeOperation($jokeCacheService, $cache);
|
||||
|
||||
$app = new \Ahc\Cli\Application('Joke App', 'v0.0.1');
|
||||
$app->add(new \App\Command\JokeCommand($jokeOperation));
|
||||
$app->add(new \App\Command\JokeCommand($jokeOperation, $jokeOperationWithCache));
|
||||
$app->handle($_SERVER['argv']);
|
||||
|
||||
Reference in New Issue
Block a user