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

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
namespace Psonic\Commands;
4
5
use Psonic\Contracts\Command as CommandInterface;
6
7
abstract class Command implements CommandInterface
8
{
9
    private $command;
10
    private $parameters;
11
12
    public function __construct($command, $parameters = [])
13
    {
14
        $this->command = $command;
15
        $this->parameters = $parameters;
16
    }
17
18
    /**
19
     * Wrap the string in quotes, and normalize whitespace. Also remove double quotes.
20
     */
21
    protected function wrapInQuotes($string)
22
    {
23
        $string = preg_replace('/[\r\n\t"]/', ' ', $string);
24
        $string = '"' . str_replace('"', '\"', $string) . '"';
25
        return $string;
26
    }
27
28
    public function __toString(): string
29
    {
30
        return $this->command . " " . implode(" ", $this->parameters) . "\n";
31
    }
32
}
33