Passed
Push — master ( 9afe80...f5220c )
by Gabriel
03:51
created

EntrypointsCollection::has()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
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
    public function __construct($entries = null)
21
    {
22
        $this->entries = $entries;
23
    }
24
25
    /**
26
     * @inheritDoc
27
     * @return EntrypointLookupInterface
28
     */
29
    public function get($id)
30
    {
31
        if (!$this->has($id)) {
32
            return null;
33
        }
34
35
        return $this->entries[$id];
36
    }
37
38
    /**
39
     * @inheritDoc
40
     */
41
    public function has($id)
42
    {
43
        return isset($this->entries[$id]);
44
    }
45
}
46