Passed
Push — feature/unit-tests ( 84c996...7c5ff9 )
by Daniel
05:24
created

SilverbackApiComponentBundle   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 4
b 0
f 0
dl 0
loc 10
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 8 2
1
<?php
2
3
/*
4
 * This file is part of the Silverback API Component Bundle Project
5
 *
6
 * (c) Daniel West <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Silverback\ApiComponentBundle;
15
16
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass;
17
use Silverback\ApiComponentBundle\DependencyInjection\CompilerPass\ApiPlatformCompilerPass;
18
use Silverback\ApiComponentBundle\DependencyInjection\CompilerPass\DoctrineCompilerPass;
19
use Silverback\ApiComponentBundle\DependencyInjection\CompilerPass\ImagineCompilerPass;
20
use Symfony\Component\DependencyInjection\ContainerBuilder;
21
use Symfony\Component\HttpKernel\Bundle\Bundle;
22
use function class_exists;
23
24
/**
25
 * @author Daniel West <[email protected]>
26
 */
27
class SilverbackApiComponentBundle extends Bundle
28
{
29 1
    public function build(ContainerBuilder $container): void
30
    {
31 1
        parent::build($container);
32 1
        if (class_exists(DoctrineOrmMappingsPass::class)) {
33 1
            $container->addCompilerPass(new DoctrineCompilerPass());
34
        }
35 1
        $container->addCompilerPass(new ImagineCompilerPass());
36 1
        $container->addCompilerPass(new ApiPlatformCompilerPass());
37 1
    }
38
}
39