Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
1 / 1
ApiGenerateCommand
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
3 / 3
3
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getAllowedAppEnvs
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 handle
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace Olz\Command;
4
5use Olz\Api\OlzApi;
6use Olz\Command\Common\OlzCommand;
7use Symfony\Component\Console\Attribute\AsCommand;
8use Symfony\Component\Console\Command\Command;
9use Symfony\Component\Console\Input\InputInterface;
10use Symfony\Component\Console\Output\OutputInterface;
11
12#[AsCommand(name: 'olz:api-generate')]
13class ApiGenerateCommand extends OlzCommand {
14    public function __construct(protected OlzApi $olzApi) {
15        parent::__construct();
16    }
17
18    /** @return array<string> */
19    protected function getAllowedAppEnvs(): array {
20        return ['dev', 'test'];
21    }
22
23    protected function handle(InputInterface $input, OutputInterface $output): int {
24        $this->olzApi->generate();
25        return Command::SUCCESS;
26    }
27}