Completed
Pull Request — master (#26)
by Paulo Rodrigues
04:47
created

Manifest   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 90.91%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A all() 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
    private $entries;
8
9 3
    public function __construct(array $entries)
10
    {
11 3
        $this->entries = $entries;
12 3
    }
13
14 3
    public function all()
15
    {
16 3
        return $this->entries;
17
    }
18
19 3
    public function has($path)
20
    {
21 3
        return array_key_exists($path, $this->entries);
22
    }
23
24 3
    public function get($path)
25
    {
26 3
        if (!$this->has($path)) {
27
            return;
28
        }
29
30 3
        return $this->entries[$path];
31
    }
32
}
33