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.

StopServer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 7

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 2
c 3
b 0
f 0
lcom 0
cbo 7
dl 0
loc 40
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 9 1
A execute() 0 13 1
1
<?php
2
namespace SeleniumSetup\Controller;
3
4
use SeleniumSetup\Config\Config;
5
use SeleniumSetup\Config\ConfigFactory;
6
use SeleniumSetup\Environment;
7
use SeleniumSetup\Locker\Locker;
8
use SeleniumSetup\Service\StopServerService;
9
use Symfony\Component\Console\Command\Command;
10
use Symfony\Component\Console\Input\InputArgument;
11
use Symfony\Component\Console\Input\InputInterface;
12
use Symfony\Component\Console\Output\OutputInterface;
13
14
class StopServer extends Command
15
{
16
    const CLI_COMMAND = 'stop';
17
    
18
    /**
19
     * Configure the command options.
20
     *
21
     * @return void
22
     */
23
    protected function configure()
24
    {
25
        $defaultName = basename(Config::DEFAULT_CONFIGURATION_FILENAME, '.json');
26
27
        $this
28
            ->setName(self::CLI_COMMAND)
29
            ->setDescription('Stop Selenium Server.')
30
            ->addArgument('name', InputArgument::OPTIONAL, 'The name of the server.', $defaultName);
31
    }
32
33
    /**
34
     * Execute the command.
35
     *
36
     * @param  \Symfony\Component\Console\Input\InputInterface  $input
37
     * @param  \Symfony\Component\Console\Output\OutputInterface  $output
38
     * @return void
39
     */
40
    public function execute(InputInterface $input, OutputInterface $output)
41
    {
42
        $locker = new Locker();
43
        $locker->openLockFile();
44
        $serverItem = $locker->getServer($input->getArgument('name'));
45
46
        // Prepare.
47
        $config = ConfigFactory::createFromConfigFile($serverItem->getConfigFilePath());
48
        $env = new Environment($config, $input, $output);
49
50
        $handler = new StopServerService($config, $env, $input, $output);
51
        $handler->handle();
52
    }
53
}