EntrypointsCollection   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 88.89%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 32
ccs 8
cts 9
cp 0.8889
rs 10
c 0
b 0
f 0
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A has() 0 3 1
A get() 0 7 2
A __construct() 0 3 1
1
<?php
2
3
namespace ByTIC\Assets\Encore;
4
5
use Psr\Container\ContainerInterface;
6
use Symfony\WebpackEncoreBundle\Asset\EntrypointLookupInterface;
7
8
/**
9
 * Class EntrypointsCollection
10
 * @package ByTIC\Assets\Encore
11
 */
12
class EntrypointsCollection implements ContainerInterface
13
{
14
    protected $entries = [];
15
16
    /**
17
     * EntrypointsCollection constructor.
18
     * @param array $entries
19
     */
20 7
    public function __construct($entries = null)
21
    {
22 7
        $this->entries = $entries;
23 7
    }
24
25
    /**
26
     * @inheritDoc
27
     * @return EntrypointLookupInterface
28
     */
29 5
    public function get($id)
30
    {
31 5
        if (!$this->has($id)) {
32
            return null;
33
        }
34
35 5
        return $this->entries[$id];
36
    }
37
38
    /**
39
     * @inheritDoc
40
     */
41 5
    public function has($id)
42
    {
43 5
        return isset($this->entries[$id]);
44
    }
45
}
46