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.

ApiCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 22
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A mergeApplicationDefinition() 0 19 3
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the "php-ipfs" package.
7
 *
8
 * (c) Robert Schönthal <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace IPFS\Console;
15
16
use IPFS\Driver\Http;
17
use Symfony\Component\Console\Command\Command;
18
use Symfony\Component\Console\Exception\LogicException;
19
use Symfony\Component\Console\Input\InputOption;
20
21
class ApiCommand extends Command
22
{
23 2
    public function mergeApplicationDefinition($mergeArgs = true)
24
    {
25 2
        $originalOptions = $this->getApplication()->getDefinition()->getOptions();
26 2
        $this->getApplication()->getDefinition()->setOptions([]);
27
28 2
        parent::mergeApplicationDefinition($mergeArgs);
29
30 2
        foreach ($originalOptions as $option) {
31
            try {
32 2
                $this->getDefinition()->addOption($option);
33 2
            } catch (LogicException $e) {
34
                //option already defined by command itself
35
            }
36
        }
37
38 2
        $this->getDefinition()->addOption(new InputOption('--driver', '', InputOption::VALUE_REQUIRED, 'which driver to use', Http::class));
39
40 2
        $this->getApplication()->getDefinition()->setOptions($originalOptions);
41 2
    }
42
}
43