mirror of
https://github.com/Dannecron/test-php8-attributes.git
synced 2025-12-25 13:22:34 +03:00
24 lines
461 B
PHP
24 lines
461 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Command;
|
|
|
|
use App\Operation\JokeOperation;
|
|
|
|
class JokeCommand extends \Ahc\Cli\Input\Command
|
|
{
|
|
public function __construct(
|
|
private JokeOperation $jokeOperation
|
|
) {
|
|
parent::__construct('joke', 'Get some joke');
|
|
}
|
|
|
|
public function execute(): void
|
|
{
|
|
$io = $this->app()->io();
|
|
$joke = $this->jokeOperation->getRandomJoke();
|
|
$io->green($joke, true);
|
|
}
|
|
}
|