Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 29
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
OnDailyCommand
0.00% covered (danger)
0.00%
0 / 29
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 1
 getAllowedAppEnvs
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 handle
0.00% covered (danger)
0.00%
0 / 28
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace Olz\Command;
4
5use Olz\Command\Common\OlzCommand;
6use Symfony\Component\Console\Attribute\AsCommand;
7use Symfony\Component\Console\Command\Command;
8use Symfony\Component\Console\Input\ArrayInput;
9use Symfony\Component\Console\Input\InputInterface;
10use Symfony\Component\Console\Output\OutputInterface;
11
12#[AsCommand(name: 'olz:on-daily')]
13class OnDailyCommand extends OlzCommand {
14    /** @return array<string> */
15    protected function getAllowedAppEnvs(): array {
16        return ['dev', 'test', 'staging', 'prod'];
17    }
18
19    protected function handle(InputInterface $input, OutputInterface $output): int {
20        set_time_limit(4000);
21        ignore_user_abort(true);
22
23        $this->symfonyUtils()->callCommand(
24            'olz:clean-temp-directory',
25            new ArrayInput([]),
26            $output,
27        );
28        $this->symfonyUtils()->callCommand(
29            'olz:clean-temp-database',
30            new ArrayInput([]),
31            $output,
32        );
33        $this->symfonyUtils()->callCommand(
34            'olz:send-telegram-configuration',
35            new ArrayInput([]),
36            $output,
37        );
38        $this->symfonyUtils()->callCommand(
39            'olz:sync-solv',
40            new ArrayInput([]),
41            $output,
42        );
43
44        // TODO: Remove this again!
45        $this->symfonyUtils()->callCommand(
46            'olz:send-test-email',
47            new ArrayInput([]),
48            $output,
49        );
50
51        return Command::SUCCESS;
52    }
53}