1 | <?php |
||
2 | |||
3 | namespace ByTIC\Assets\Assets\Traits; |
||
4 | |||
5 | use ByTIC\Assets\Assets\EntryPoint; |
||
6 | |||
7 | /** |
||
8 | * Trait HasEntriesTrait |
||
9 | * @package ByTIC\Assets\Assets\Traits |
||
10 | */ |
||
11 | trait HasEntriesTrait |
||
12 | { |
||
13 | /** |
||
14 | * All of the instantiated asset containers. |
||
15 | * |
||
16 | * @var array |
||
17 | */ |
||
18 | protected $entries = []; |
||
19 | |||
20 | /** |
||
21 | * @param string $entry |
||
22 | * @return EntryPoint |
||
23 | */ |
||
24 | 1 | public static function entry(string $entry = '_default') |
|
0 ignored issues
–
show
|
|||
25 | { |
||
26 | 1 | return static::instance()->getEntry(); |
|
27 | } |
||
28 | |||
29 | /** |
||
30 | * @param string $entry |
||
31 | * @return EntryPoint |
||
32 | */ |
||
33 | 1 | public function getEntry(string $entry = '_default') |
|
34 | { |
||
35 | 1 | if (!isset($this->entries[$entry])) { |
|
36 | 1 | $this->entries[$entry] = new EntryPoint(); |
|
37 | } |
||
38 | |||
39 | 1 | return $this->entries[$entry]; |
|
40 | } |
||
41 | } |
||
42 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.