ItemLabelDecorator::decorate()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 2
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 2
nc 2
nop 2
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\Menu\KnpMenu;
13
14
use FSi\Bundle\AdminBundle\Menu\Item\Item as AdminMenuItem;
15
use Knp\Menu\ItemInterface as KnpMenuItem;
16
17
class ItemLabelDecorator implements ItemDecorator
18
{
19
    public function decorate(KnpMenuItem $knpMenuItem, AdminMenuItem $adminMenuItem): void
20
    {
21
        if (null !== $adminMenuItem->getLabel()) {
22
            $knpMenuItem->setLabel($adminMenuItem->getLabel());
23
        }
24
    }
25
}
26