Completed
Push — navigation ( b9a6ad )
by Arnaud
16:10
created

Collection::__isset()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 7
rs 10
c 1
b 1
f 0
1
<?php
2
/**
3
 * This file is part of the Cecil/Cecil package.
4
 *
5
 * Copyright (c) Arnaud Ligny <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Cecil\Collection\Menu;
12
13
use Cecil\Collection\Collection as CecilCollection;
14
use Cecil\Collection\ItemInterface;
15
16
/**
17
 * Class Collection.
18
 */
19
class Collection extends CecilCollection
20
{
21
    /**
22
     * Return a Menu collection.
23
     * {@inheritdoc}
24
     */
25
    public function get(string $id): ItemInterface
26
    {
27
        return parent::get($id);
28
    }
29
30
    /**
31
     * Checks if menu exists.
32
     */
33
    public function __isset(string $id): bool
34
    {
35
        if ($this->has($id)) {
36
            return true;
37
        }
38
39
        throw new \Exception(\sprintf('Menu "%s" not found', $id));
40
    }
41
}
42