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::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 15
rs 9.4286
c 1
b 0
f 1
cc 1
eloc 9
nc 1
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 ($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