Server   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 4
c 3
b 0
f 0
lcom 2
cbo 1
dl 0
loc 30
ccs 10
cts 10
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getHost() 0 4 1
A getUsername() 0 4 1
A getPassword() 0 4 1
A checkValidity() 0 7 1
1
<?php
2
3
namespace Onigoetz\Deployer\Configuration;
4
5
use Onigoetz\Deployer\Configuration\Containers\ConfigurationContainer;
6
7
class Server extends ConfigurationContainer
8
{
9
    public static $defaultPassword = null;
10
11 27
    public function getHost()
12
    {
13 27
        return $this->getValueOrFail('host', "no 'host' specified in server '{$this->name}'");
14
    }
15
16 24
    public function getUsername()
17
    {
18 24
        return $this->getValueOrFail('username', "no 'username' specified in server '{$this->name}'");
19
    }
20
21 6
    public function getPassword()
22
    {
23 6
        return $this->getValueOrDefault('password', self::$defaultPassword);
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29 21
    public function checkValidity()
30
    {
31 21
        $this->getHost();
32 18
        $this->getUsername();
33
34 12
        return true;
35
    }
36
}
37