Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| HelloCommand | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| execute | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace App\Console; |
| 6 | |
| 7 | use Symfony\Component\Console\Attribute\AsCommand; |
| 8 | use Symfony\Component\Console\Command\Command; |
| 9 | use Symfony\Component\Console\Input\InputInterface; |
| 10 | use Symfony\Component\Console\Output\OutputInterface; |
| 11 | use Yiisoft\Yii\Console\ExitCode; |
| 12 | |
| 13 | #[AsCommand( |
| 14 | name: 'hello', |
| 15 | description: 'An example command', |
| 16 | )] |
| 17 | class HelloCommand extends Command |
| 18 | { |
| 19 | protected function execute(InputInterface $input, OutputInterface $output): int |
| 20 | { |
| 21 | $output->writeln('Hello!'); |
| 22 | return ExitCode::OK; |
| 23 | } |
| 24 | } |