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.
Completed
Push — master ( aaa283...38e978 )
by Anton
02:16
created

Local::mustRun()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 7
nc 1
nop 2
dl 0
loc 10
ccs 0
cts 0
cp 0
crap 2
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/* (c) Anton Medvedev <[email protected]>
3
 *
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 */
7
8
namespace Deployer\Server;
9
10
use Symfony\Component\Process\Process;
11
12
class Local implements ServerInterface
13
{
14
    const TIMEOUT = 300;
15
16
    /**
17
     * @var Configuration
18
     */
19 1
    private $configuration;
20
21
    /**
22 1
     * Local constructor.
23
     * @param $config
24
     */
25
    public function __construct(Configuration $config = null)
26
    {
27 12
        if ($config === null) {
28
            $config = new Configuration('localhost', 'localhost');
29 12
        }
30
31 12
        $this->configuration = $config;
32 12
    }
33 12
34
    /**
35 12
     * @return Configuration
36
     */
37
    public function getConfiguration()
38
    {
39
        return $this->configuration;
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public function connect()
46
    {
47
        // We do not need to connect to local server.
48
    }
49
50
    /**
51
     * {@inheritdoc}
52
     */
53
    public function run($command)
54
    {
55
        return $this->mustRun($command);
56
    }
57
58
    /**
59
     * @param string $command
60
     * @param callable $callback
61
     * @return string
62
     */
63
    public function mustRun($command, $callback = null)
64
    {
65
        $process = new Process($command);
66
        $process
67
            ->setTimeout(self::TIMEOUT)
68
            ->setIdleTimeout(self::TIMEOUT)
69
            ->mustRun($callback);
70
71
        return $process->getOutput();
72
    }
73
74
    /**
75
     * {@inheritdoc}
76
     */
77
    public function upload($local, $remote)
78
    {
79
        copy($local, $remote);
80
    }
81
82
    /**
83
     * {@inheritdoc}
84
     */
85
    public function download($local, $remote)
86
    {
87
        copy($remote, $local);
88
    }
89
}
90