Collection::__isset()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
c 0
b 0
f 0
nc 2
nop 1
dl 0
loc 7
rs 10
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