Manifest   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 47
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A all() 0 4 1
A __construct() 0 4 1
A has() 0 4 1
A get() 0 8 2
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