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.

RegisterServer::configure()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
namespace SeleniumSetup\Controller;
3
4
use SeleniumSetup\Config\ConfigFactory;
5
use SeleniumSetup\Environment;
6
use SeleniumSetup\Service\RegisterServerService;
7
use Symfony\Component\Console\Input\InputArgument;
8
use Symfony\Component\Console\Input\InputOption;
9
use Symfony\Component\Console\Command\Command;
10
use Symfony\Component\Console\Input\InputInterface;
11
use Symfony\Component\Console\Output\OutputInterface;
12
13
class RegisterServer extends Command
14
{
15
    const CLI_COMMAND = 'register';
16
    
17
    /**
18
     * Configure the command options.
19
     *
20
     * @return void
21
     */
22
    protected function configure()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
23
    {
24
        $this
25
            ->setName(self::CLI_COMMAND)
26
            ->setDescription('Register a SeleniumSetup server instance.')
27
            ->addOption('config', 'c', InputOption::VALUE_OPTIONAL, 'The config path.')
28
            ->addArgument('name', InputArgument::REQUIRED, 'Instance name.')
29
            ->addArgument('port', InputArgument::REQUIRED, 'Instance port.');
30
    }
31
32
    /**
33
     * Execute the command.
34
     *
35
     * @param  \Symfony\Component\Console\Input\InputInterface  $input
36
     * @param  \Symfony\Component\Console\Output\OutputInterface  $output
37
     * @return void
38
     */
39
    protected function execute(InputInterface $input, OutputInterface $output)
40
    {
41
        $configFilePath = null;
42
43
        if ($input->getOption('config')) {
44
            $configFilePath = realpath($input->getOption('config'));
45
        }
46
47
        // Prepare.
48
        $config = ConfigFactory::createFromConfigFile($configFilePath);
49
        $env = new Environment($config, $input, $output);
50
51
        $handler = new RegisterServerService($config, $env, $input, $output);
52
        $handler->handle();
53
    }
54
}
55