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.

RemoveSiteCommand::execute()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 13
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 9
nc 2
nop 2
1
<?php
2
3
namespace Selim\Commands;
4
5
use Selim\Util;
6
use Symfony\Component\Console\Input\InputArgument;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
class RemoveSiteCommand extends SelimCommand{
11
    protected function configure()
12
    {
13
        parent::configure();
14
        $this
15
            ->setName('rm')
16
            ->setDescription('Remove a Site')
17
            ->addArgument(
18
                'name',
19
                InputArgument::REQUIRED,
20
                'Identifier for your Site'
21
            );
22
    }
23
24
    protected function execute(InputInterface $input, OutputInterface $output)
25
    {
26
        $name = $input->getArgument('name');
27
        $cfg = $this->getSelimConfig($input);
28
29
        if ($cfg->siteExists($name)) {
30
            $cfg->removeSite($name);
31
            $cfg->write();
32
            echo "removed: '$name'".PHP_EOL;
33
        } else {
34
            Util::reportError("Site with name '$name' doesn't exists!");
35
        }
36
    }
37
}