Directories::getDeploy()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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