TestBoot   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 77
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 77
c 1
b 0
f 0
wmc 10
lcom 1
cbo 0
rs 10

9 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A isValid() 0 4 1
A getBootstrap() 0 10 2
A getPath() 0 4 1
A getSiteSelector() 0 4 1
A getFrameworkVersion() 0 4 1
A getServiceFeatures() 0 4 1
A boot() 0 4 1
A terminate() 0 3 1
1
<?php
2
namespace Consolidation\TestUtils;
3
4
use Consolidation\Bootstrap\BootInterface;
5
use Consolidation\Bootstrap\BootstrapSelectionInterface;
6
7
class TestBoot implements BootInterface, BootstrapSelectionInterface
8
{
9
    protected $path;
10
    protected $siteSelector;
11
    protected $version;
12
    protected $services;
13
14
    public function __construct($path, $version, $services)
15
    {
16
        $this->path = $path;
17
        $this->version = $version;
18
        $this->services = $services;
19
    }
20
21
    /**
22
     * @inheritdoc
23
     */
24
    public function isValid($path)
25
    {
26
        return $this->path == $path;
27
    }
28
29
    /**
30
     * @inheritdoc
31
     */
32
    public function getBootstrap($path, $siteSelector = null)
33
    {
34
        if (!$this->isValid($path)) {
35
            throw new \RuntimeException('Invalid path passed to getBootstrap().');
36
        }
37
        $this->siteSelector = $siteSelector;
38
        // Normally we would instantiate a new BootInterface and pass
39
        // the $path to its constructor.
40
        return $this;
41
    }
42
43
    public function getPath()
44
    {
45
        return $this->path;
46
    }
47
48
    public function getSiteSelector()
49
    {
50
        return $this->siteSelector;
51
    }
52
53
    /**
54
     * @inheritdoc
55
     */
56
    public function getFrameworkVersion()
57
    {
58
        return $this->version;
59
    }
60
61
    /**
62
     * @inheritdoc
63
     */
64
    public function getServiceFeatures()
65
    {
66
        return $this->services;
67
    }
68
69
    /**
70
     * @inheritdoc
71
     */
72
    public function boot($serviceFeatures, $siteSelector = null)
73
    {
74
        return true;
75
    }
76
77
    /**
78
     * @inheritdoc
79
     */
80
    public function terminate()
81
    {
82
    }
83
}
84