MenuBundle   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 13
rs 10
c 2
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getContainerExtension() 0 11 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Braunstetter\MenuBundle;
6
7
use Braunstetter\MenuBundle\DependencyInjection\MenuBundleExtension;
8
use Symfony\Component\HttpKernel\Bundle\Bundle;
9
use Webmozart\Assert\Assert;
10
11
class MenuBundle extends Bundle
12
{
13
    public function getContainerExtension(): ?MenuBundleExtension
14
    {
15
        if ($this->extension === null) {
16
            $this->extension = new MenuBundleExtension();
17
        }
18
        Assert::isInstanceOf(
19
            $this->extension,
20
            MenuBundleExtension::class,
21
            'The extension must be an instance of MenuBundleExtension'
22
        );
23
        return $this->extension;
24
    }
25
}
26