Collection   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 21
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 3 1
A __isset() 0 7 2
1
<?php
2
3
/**
4
 * This file is part of Cecil.
5
 *
6
 * (c) Arnaud Ligny <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Cecil\Collection\Menu;
15
16
use Cecil\Collection\Collection as CecilCollection;
17
use Cecil\Collection\ItemInterface;
18
19
/**
20
 * Menu collection class.
21
 *
22
 * Represents a collection of menus, providing methods to retrieve and check for existence of menus.
23
 */
24
class Collection extends CecilCollection
25
{
26
    /**
27
     * Return a Menu collection.
28
     * {@inheritdoc}
29
     */
30
    public function get(string $id): ItemInterface
31
    {
32
        return parent::get($id);
33
    }
34
35
    /**
36
     * Checks if menu exists.
37
     */
38
    public function __isset(string $id): bool
39
    {
40
        if ($this->has($id)) {
41
            return true;
42
        }
43
44
        return false;
45
    }
46
}
47