ClearCacheUtils::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 11
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Locastic\SymfonyTranslationBundle\Utils;
6
7
use Exception;
8
use Symfony\Bundle\FrameworkBundle\Console\Application;
9
use Symfony\Component\Console\Input\ArrayInput;
10
use Symfony\Component\Console\Output\NullOutput;
11
use Symfony\Component\HttpKernel\KernelInterface;
12
13
final class ClearCacheUtils
14
{
15
    /**
16
     * @throws Exception
17
     */
18
    public function __invoke(KernelInterface $kernel): void
19
    {
20
        $application = new Application($kernel);
21
        $application->setAutoExit(false);
22
23
        $input = new ArrayInput([
24
            'command' => 'cache:clear',
25
        ]);
26
27
        $output = new NullOutput();
28
        $application->run($input, $output);
29
    }
30
}
31