Passed
Push — master ( 7b8fee...274ba6 )
by Ivan
01:54
created

NavigationRegistry::getNavigation()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 2
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Everlution\Navigation\Registry;
6
7
use Everlution\Navigation\RootNavigationItem;
8
9
/**
10
 * Class NavigationRegistry.
11
 * @author Ivan Barlog <[email protected]>
12
 */
13
class NavigationRegistry extends ProviderRegistry
14
{
15
    /**
16
     * @param string $slug
17
     * @param string $label
18
     * @return RootNavigationItem
19
     */
20
    public function getNavigation(string $slug, string $label)
21
    {
22
        $navigation = new RootNavigationItem($slug, $label);
23
24
        foreach ($this->register as $provider) {
25
            $provider->accept($navigation);
26
        }
27
28
        return $navigation;
29
    }
30
}
31