GeneratorContainer   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
eloc 7
c 1
b 0
f 1
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 4
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Everlution\Navigation;
6
7
use Everlution\Navigation\Item\GeneratorInterface;
8
9
class GeneratorContainer extends MutableContainer
10
{
11
    public function __construct(ContainerInterface $container)
12
    {
13
        foreach ($container->getItems() as $item) {
14
            if ($item instanceof GeneratorInterface) {
15
                foreach ($item->generate() as $generatedItem) {
16
                    $this->add($generatedItem);
17
                }
18
19
                continue;
20
            }
21
22
            $this->add($item);
23
        }
24
    }
25
}
26