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

Manifest::get()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.0625

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
ccs 3
cts 4
cp 0.75
cc 2
eloc 4
nc 2
nop 1
crap 2.0625
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