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.
Test Failed
Pull Request — master (#1470)
by Markus
03:01 queued 51s
created

SeriesExecutor   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Test Coverage

Coverage 86.96%

Importance

Changes 0
Metric Value
dl 0
loc 64
ccs 20
cts 23
cp 0.8696
rs 10
c 0
b 0
f 0
wmc 8
lcom 1
cbo 5

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
C run() 0 30 7
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\Executor;
9
10
use Deployer\Console\Output\Informer;
11
use Deployer\Exception\NonFatalException;
12
use Deployer\Host\Localhost;
13
use Deployer\Task\Context;
14
use Symfony\Component\Console\Input\InputInterface;
15
use Symfony\Component\Console\Output\OutputInterface;
16
17
class SeriesExecutor implements ExecutorInterface
18
{
19
    /**
20
     * @var InputInterface
21
     */
22
    private $input;
23
24
    /**
25
     * @var OutputInterface
26
     */
27
    private $output;
28
29
    /**
30
     * @var Informer
31
     */
32
    private $informer;
33
34
    /**
35
     * @param InputInterface $input
36
     * @param OutputInterface $output
37
     * @param Informer $informer
38
     */
39 6
    public function __construct(InputInterface $input, OutputInterface $output, Informer $informer)
40
    {
41 6
        $this->input = $input;
42 6
        $this->output = $output;
43 6
        $this->informer = $informer;
44 6
    }
45
46
47
    /**
48
     * {@inheritdoc}
49
     */
50 6
    public function run($tasks, $hosts)
51
    {
52 6
        $localhost = new Localhost();
53 6
        foreach ($tasks as $task) {
54 6
            $success = true;
55 6
            $this->informer->startTask($task);
56
57 6
            if ($task->isLocal()) {
58 1
                $task->run(new Context($localhost, $this->input, $this->output));
59
            } else {
60 5
                foreach ($hosts as $host) {
61 5
                    if ($task->shouldBePerformed($host)) {
62
                        try {
63 5
                            $task->run(new Context($host, $this->input, $this->output));
64
                        } catch (NonFatalException $exception) {
65
                            $success = false;
66
                            $this->informer->taskException($exception, $host);
67
                        }
68 5
                        $this->informer->endOnHost($host->getHostname());
69
                    }
70
                }
71
            }
72
73 6
            if ($success) {
74 6
                $this->informer->endTask($task);
75
            } else {
76 6
                $this->informer->taskError();
77
            }
78
        }
79 6
    }
80
}
81