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
Pull Request — master (#953)
by
unknown
02:33
created

ClusterBuilder   A

Complexity

Total Complexity 19

Size/Duplication

Total Lines 117
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 53.49%

Importance

Changes 0
Metric Value
dl 0
loc 117
c 0
b 0
f 0
ccs 23
cts 43
cp 0.5349
rs 10
wmc 19
lcom 1
cbo 0

10 Methods

Rating   Name   Duplication   Size   Complexity  
A password() 0 7 2
A configFile() 0 7 2
A __construct() 0 4 1
A user() 0 7 2
A identityFile() 0 10 2
A pemFile() 0 7 2
A forwardAgent() 0 7 2
A stage() 0 7 2
A set() 0 7 2
A pty() 0 7 2
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\Cluster;
9
10
use Deployer\Builder\BuilderInterface;
11
12
/**
13
 * ClusterBuilder
14
 * Defines a node for cluster
15
 *
16
 * @author Irfan Durmus (http://github.com/irfan) <[email protected]>
17
 */
18
class ClusterBuilder implements BuilderInterface
19
{
20
    /**
21
     * @var array|\Deployer\Cluster\Node[]
22
     */
23
    protected $nodes = null;
24
25
    /**
26
     * @param array|\Deployer\Cluster\Node[] $nodes
27
     */
28 3
    public function __construct(array $nodes)
29
    {
30 3
        $this->nodes = $nodes;
31 3
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36 1
    public function user($user)
37
    {
38 1
        foreach ($this->nodes as $node) {
39 1
            $node->builder->user($user);
40 1
        }
41 1
        return $this;
42
    }
43
44
    /**
45
     * {@inheritdoc}
46
     */
47 1
    public function password($password = null)
48
    {
49 1
        foreach ($this->nodes as $node) {
50 1
            $node->builder->password($password);
51 1
        }
52 1
        return $this;
53
    }
54
55
    /**
56
     * {@inheritdoc}
57
     */
58
    public function configFile($file = '~/.ssh/config')
59
    {
60
        foreach ($this->nodes as $node) {
61
            $node->builder->configFile($file);
62
        }
63
        return $this;
64
    }
65
66
    /**
67
     * {@inheritdoc}
68
     */
69
    public function identityFile(
70
        $publicKeyFile = '~/.ssh/id_rsa.pub',
71
        $privateKeyFile = '~/.ssh/id_rsa',
72
        $passPhrase = ''
73
    ) {
74
        foreach ($this->nodes as $node) {
75
            $node->builder->identityFile($publicKeyFile, $privateKeyFile, $passPhrase);
76
        }
77
        return $this;
78
    }
79
80
    /**
81
     * {@inheritdoc}
82
     */
83
    public function pemFile($pemFile)
84
    {
85
        foreach ($this->nodes as $node) {
86
            $node->builder->pemFile($pemFile);
87
        }
88
        return $this;
89
    }
90
91
    /**
92
     * {@inheritdoc}
93
     */
94
    public function forwardAgent()
95
    {
96
        foreach ($this->nodes as $node) {
97
            $node->builder->forwardAgent();
98
        }
99
        return $this;
100
    }
101
102
    /**
103
     * {@inheritdoc}
104
     */
105 1
    public function set($name, $env)
106
    {
107 1
        foreach ($this->nodes as $node) {
108 1
            $node->builder->set($name, $env);
109 1
        }
110 1
        return $this;
111
    }
112
113
    /**
114
     * {@inheritdoc}
115
     */
116 1
    public function stage($stages)
117
    {
118 1
        foreach ($this->nodes as $node) {
119 1
            $node->builder->stage($stages);
120 1
        }
121 1
        return $this;
122
    }
123
124
    /**
125
     * {@inheritdoc}
126
     */
127
    public function pty($stages)
128
    {
129
        foreach ($this->nodes as $node) {
130
            $node->builder->pty($stages);
131
        }
132
        return $this;
133
    }
134
}
135