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.
Passed
Pull Request — master (#1061)
by Maxim
04:23 queued 01:35
created

SeriesExecutor   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 7

Test Coverage

Coverage 88.89%

Importance

Changes 0
Metric Value
dl 0
loc 43
ccs 24
cts 27
cp 0.8889
rs 10
c 0
b 0
f 0
wmc 8
lcom 0
cbo 7

1 Method

Rating   Name   Duplication   Size   Complexity  
C run() 0 37 8
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\OutputWatcher;
11
use Deployer\Server\Environment;
12
use Deployer\Server\Local;
13
use Deployer\Task\Context;
14
use Deployer\Exception\NonFatalException;
15
16
class SeriesExecutor implements ExecutorInterface
17
{
18
    /**
19
     * {@inheritdoc}
20
     */
21 10
    public function run($tasks, $servers, $environments, $input, $output)
22
    {
23 10
        $output = new OutputWatcher($output);
24 10
        $informer = new Informer($output);
25 10
        $localhost = new Local();
26 10
        $localEnv = new Environment();
27
28 10
        foreach ($tasks as $task) {
29 10
            $success = true;
30 10
            $informer->startTask($task->getName());
31
32 10
            if ($task->isOnce()) {
33 1
                $task->run(new Context($localhost, $localEnv, $input, $output));
34 1
            } else {
35 10
                foreach ($servers as $serverName => $server) {
36 10
                    if ($task->isOnServer($serverName)) {
37 10
                        $env = isset($environments[$serverName]) ? $environments[$serverName] : $environments[$serverName] = new Environment();
38
39
                        try {
40 10
                            $task->run(new Context($server, $env, $input, $output));
41 10
                        } catch (NonFatalException $exception) {
42
                            $success = false;
43
                            $informer->taskException($serverName, 'Deployer\Exception\NonFatalException', $exception->getMessage());
44
                        }
45
46 10
                        $informer->endOnServer($serverName);
47 10
                    }
48 10
                }
49
            }
50
51 10
            if ($success) {
52 10
                $informer->endTask();
53 10
            } else {
54
                $informer->taskError();
55
            }
56 10
        }
57 10
    }
58
}
59