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 ( 8a607c...958232 )
by Roderik
13:19
created

WebserverCommand::doExecute()   B

Complexity

Conditions 4
Paths 4

Size

Total Lines 26
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 1
Metric Value
c 2
b 1
f 1
dl 0
loc 26
rs 8.5806
cc 4
eloc 12
nc 4
nop 0
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 (PHP_OS == "Darwin") {
41
                $this->processProvider->executeSudoCommand("apachectl -k restart");
42
            }
43
            else{
44
                if ($this->app["config"]["webserver"]["engine"] == 'nginx') {
45
                    $this->processProvider->executeSudoCommand("service nginx reload");
46
                } else {
47
                    $this->processProvider->executeSudoCommand("service apache2 reload");
48
                }
49
            }
50
51
        }
52
        else
53
        {
54
            $this->dialogProvider->logError("Webserver action '$action' not implemented", true);
55
        }
56
57
    }
58
}
59