Directories   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 6
Bugs 0 Features 1
Metric Value
wmc 6
c 6
b 0
f 1
lcom 1
cbo 1
dl 0
loc 41
ccs 13
cts 13
cp 1
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getRoot() 0 4 1
A getBinaries() 0 4 1
A getBinaryName() 0 4 1
A getDeploy() 0 4 1
A getNewBinaryName() 0 4 1
A checkValidity() 0 6 1
1
<?php
2
3
namespace Onigoetz\Deployer\Configuration;
4
5
use Onigoetz\Deployer\Configuration\Containers\InheritingConfigurationContainer;
6
7
class Directories extends InheritingConfigurationContainer
8
{
9
    public static $defaultBinaries = 'binaries';
10
    public static $defaultBinaryName = '%G-%m-%d_%H-%M';
11
    public static $defaultDeploy = 'www';
12
13 69
    public function getRoot()
14
    {
15 69
        return $this->getValueOrFail('root', 'no root directory specified');
16
    }
17
18 12
    public function getBinaries()
19
    {
20 12
        return $this->getRoot() . '/' . $this->getValueOrDefault('binaries', self::$defaultBinaries);
21
    }
22
23 15
    public function getBinaryName()
24
    {
25 15
        return $this->getValueOrDefault('binary_name', self::$defaultBinaryName);
26
    }
27
28 15
    public function getDeploy()
29
    {
30 15
        return $this->getRoot() . '/' . $this->getValueOrDefault('deploy', self::$defaultDeploy);
31
    }
32
33 6
    public function getNewBinaryName()
34
    {
35 6
        return $this->getBinaries() . '/' . strftime($this->getBinaryName());
36
    }
37
38
    /**
39
     * {@inheritdoc}
40
     */
41 27
    public function checkValidity()
42
    {
43 27
        $this->getRoot();
44
45 18
        return true;
46
    }
47
}
48