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.

Command   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 41
ccs 15
cts 15
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getAction() 0 13 1
A getArguments() 0 4 1
A getMethod() 0 4 1
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\Command;
15
16
use IPFS\Utils\CaseFormatter;
17
18
class Command
19
{
20
    /**
21
     * @var array
22
     */
23
    private $args = [];
24
    /**
25
     * @var string
26
     */
27
    private $method;
28
29 9
    public function __construct(string $method, array $args = [])
30
    {
31 9
        $this->args = $args;
32 9
        $this->method = $method;
33 9
    }
34
35 4
    public function getAction(): string
36
    {
37 4
        $parts = explode('\\', $this->method);
38 4
        $shortName = array_pop($parts);
39
40 4
        $name = CaseFormatter::camelToColon(str_replace('::', ':', $shortName));
41
42
        // correct some naming workaround due to reserved keywords
43 4
        $name = str_replace('basics:', '', $name);
44 4
        $name = str_replace('cobject:', 'object:', $name);
45
46 4
        return $name;
47
    }
48
49 4
    public function getArguments(): array
50
    {
51 4
        return $this->args;
52
    }
53
54 4
    public function getMethod(): string
55
    {
56 4
        return $this->method;
57
    }
58
}
59