ClearCacheUtils   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 16
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 11 1
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