Passed
Push — master ( b42c42...f42a03 )
by Kevin
02:22
created

ZenstruckFoundryBundle::boot()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.0625

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 2
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 4
ccs 3
cts 4
cp 0.75
crap 2.0625
rs 10
1
<?php
2
3
namespace Zenstruck\Foundry;
4
5
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
6
use Symfony\Component\HttpKernel\Bundle\Bundle;
7
use Zenstruck\Foundry\Bundle\DependencyInjection\ZenstruckFoundryExtension;
8
9
/**
10
 * Must be at src root to be auto-configured by Symfony Flex.
11
 *
12
 * @author Kevin Bond <[email protected]>
13
 */
14
final class ZenstruckFoundryBundle extends Bundle
15
{
16 118
    public function boot(): void
17
    {
18 118
        if (!Factory::isBooted()) {
19 2
            Factory::boot($this->container->get(Configuration::class));
0 ignored issues
show
Bug introduced by
It seems like $this->container->get(Ze...y\Configuration::class) can also be of type null; however, parameter $configuration of Zenstruck\Foundry\Factory::boot() does only seem to accept Zenstruck\Foundry\Configuration, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

19
            Factory::boot(/** @scrutinizer ignore-type */ $this->container->get(Configuration::class));
Loading history...
20
        }
21 118
    }
22
23 2
    protected function createContainerExtension(): ?ExtensionInterface
24
    {
25 2
        return new ZenstruckFoundryExtension();
26
    }
27
}
28