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::getAction()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 7
cts 7
cp 1
rs 9.8333
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 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