Passed
Push — master ( 1f6f72...a5203b )
by Tom
02:42
created

Definitions::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 3
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 7
ccs 4
cts 4
cp 1
crap 1
rs 10
1
<?php
2
3
/* this file is part of pipelines */
4
5
namespace Ktomk\Pipelines\File;
6
7
use Ktomk\Pipelines\File\Definitions\Services;
8
use Ktomk\Pipelines\Lib;
9
10
/**
11
 * Definitions node in pipelines file
12
 *
13
 * @package Ktomk\Pipelines\File
14
 */
15
class Definitions
16
{
17
    /**
18
     * @var array
19
     */
20
    private $array;
21
22
    /**
23
     * @var Definitions\Services
24
     */
25
    private $services;
26
27
    /**
28
     * Definitions constructor.
29
     *
30
     * @param array $array
31
     */
32 1
    public function __construct(array $array)
33
    {
34 1
        Lib::v($array['services'], array());
35
36 1
        $this->services = $this->parseDefinitionsServices($array['services']);
37
38 1
        $this->array = $array;
39 1
    }
40
41
    /**
42
     * @return Services
43
     */
44 1
    public function getServices()
45
    {
46 1
        return $this->services;
47
    }
48
49
    /**
50
     * @param array $array
51
     *
52
     * @return Services
53
     */
54 1
    private function parseDefinitionsServices(array $array)
55
    {
56 1
        return new Services($array);
57
    }
58
}
59