Passed
Push — master ( 317eaf...21e5db )
by Dāvis
03:10
created

ScriptController   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
dl 0
loc 30
rs 10
c 2
b 1
f 0
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A lexikAction() 0 3 1
A cacheAction() 0 11 2
A redisAction() 0 3 1
A generateAction() 0 3 1
1
<?php
2
3
namespace Sludio\HelperBundle\Script\Controller;
4
5
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6
7
class ScriptController extends Controller
8
{
9
    use ControllerTrait;
10
11
    public function redisAction()
12
    {
13
        return $this->runApp('sludio:redis:flush');
14
    }
15
16
    public function cacheAction()
17
    {
18
        $commands = [
19
            'clear',
20
            'warmup',
21
        ];
22
        foreach ($commands as $command) {
23
            $this->runApp('cache:'.$command, ['--env' => $this->container->get('kernel')->getEnvironment()], false);
24
        }
25
26
        return $this->result();
27
    }
28
29
    public function lexikAction()
30
    {
31
        return $this->runApp('sludio:lexik:clear');
32
    }
33
34
    public function generateAction()
35
    {
36
        return $this->runApp('sludio:translations:generate');
37
    }
38
}
39