initial commit

This commit is contained in:
2020-12-30 13:12:18 +07:00
commit f7cafcb397
10 changed files with 748 additions and 0 deletions

15
cli.php Normal file
View File

@@ -0,0 +1,15 @@
<?php
require_once __DIR__ . '/vendor/autoload.php';
$jokeGuzzle = new \GuzzleHttp\Client([
'base_uri' => 'https://v2.jokeapi.dev',
]);
$jokeService = new \App\Service\JokeService($jokeGuzzle);
$cache = new \Sarahman\SimpleCache\FileSystemCache(__DIR__ . '/tmp/cache');
$jokeOperation = new \App\Operation\JokeOperation($jokeService, $cache);
$app = new \Ahc\Cli\Application('Joke App', 'v0.0.1');
$app->add(new \App\Command\JokeCommand($jokeOperation));
$app->handle($_SERVER['argv']);