Manifest::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
ccs 3
cts 3
cp 1
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Rj\FrontendBundle\Manifest;
4
5
class Manifest
6
{
7
    /**
8
     * @var array
9
     */
10
    private $entries;
11
12
    /**
13
     * @param array $entries
14
     */
15 9
    public function __construct(array $entries)
16
    {
17 9
        $this->entries = $entries;
18 9
    }
19
20
    /**
21
     * @return array
22
     */
23 4
    public function all()
24
    {
25 4
        return $this->entries;
26
    }
27
28
    /**
29
     * @param string $path
30
     *
31
     * @return bool
32
     */
33 8
    public function has($path)
34
    {
35 8
        return array_key_exists($path, $this->entries);
36
    }
37
38
    /**
39
     * @param string $path
40
     *
41
     * @return null|string
42
     */
43 7
    public function get($path)
44
    {
45 7
        if (!$this->has($path)) {
46 1
            return null;
47
        }
48
49 7
        return $this->entries[$path];
50
    }
51
}
52