DependentElementsVisitor   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 5
c 1
b 0
f 0
dl 0
loc 10
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A visitManager() 0 8 3
1
<?php
2
3
/**
4
 * (c) FSi sp. z o.o. <[email protected]>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
10
declare(strict_types=1);
11
12
namespace FSi\Bundle\AdminBundle\Admin\Manager;
13
14
use FSi\Bundle\AdminBundle\Admin\DependentElement;
15
use FSi\Bundle\AdminBundle\Admin\ManagerInterface;
16
17
class DependentElementsVisitor implements Visitor
18
{
19
    public function visitManager(ManagerInterface $manager): void
20
    {
21
        foreach ($manager->getElements() as $element) {
22
            if (!($element instanceof DependentElement)) {
23
                continue;
24
            }
25
26
            $element->setParentElement($manager->getElement($element->getParentId()));
27
        }
28
    }
29
}
30