GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 1cfbc4...19ceb0 )
by Roderik
05:07
created

WebserverCommand   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
lcom 1
cbo 4
dl 0
loc 47
rs 10
c 1
b 0
f 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 15 1
A doExecute() 0 21 3
1
<?php
2
3
namespace Kunstmaan\Skylab\Command;
4
5
use Symfony\Component\Console\Input\InputArgument;
6
7
class WebserverCommand extends AbstractCommand
8
{
9
10
    /**
11
     * Configures the current command.
12
     */
13
    protected function configure()
14
    {
15
        $this
16
            ->addDefaults()
17
            ->setName('webserver')
18
            ->setDescription('Perform webserver operations with abstraction of the webserver engine.')
19
            ->addArgument('action', InputArgument::REQUIRED, 'Possible actions: reload')
20
            ->setHelp(<<<EOT
21
Perform webserver operations with abstraction of the webserver engine.
22
23
<info>php skylab.phar webserver reload</info>              # Reload webserver configuration
24
25
EOT
26
            );
27
    }
28
29
    /**
30
     * @throws \RuntimeException
31
     */
32
    protected function doExecute()
33
    {
34
35
        $action = $this->input->getArgument('action');
36
37
        if($action === 'reload')
38
        {
39
40
            if ($this->app["config"]["webserver"]["engine"] == 'nginx') {
41
                $this->processProvider->executeSudoCommand("service nginx reload");
42
            } else {
43
                $this->processProvider->executeSudoCommand("service apache2 reload");
44
            }
45
46
        }
47
        else
48
        {
49
            $this->dialogProvider->logError("Webserver action '$action' not implemented", true);
50
        }
51
52
    }
53
}
54