Completed
Pull Request — 3.1 (#348)
by Piotr
06:19 queued 04:50
created

FSiAdminBundle::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 9.7666
c 0
b 0
f 0
cc 1
nc 1
nop 1
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;
13
14
use Doctrine\Common\Annotations\AnnotationReader;
15
use FSi\Bundle\AdminBundle\DependencyInjection\Compiler\AdminAnnotatedElementPass;
16
use FSi\Bundle\AdminBundle\DependencyInjection\Compiler\AdminElementPass;
17
use FSi\Bundle\AdminBundle\DependencyInjection\Compiler\ContextPass;
18
use FSi\Bundle\AdminBundle\DependencyInjection\Compiler\KnpMenuBuilderPass;
19
use FSi\Bundle\AdminBundle\DependencyInjection\Compiler\ManagerVisitorPass;
20
use FSi\Bundle\AdminBundle\DependencyInjection\Compiler\ResourceRepositoryPass;
21
use FSi\Bundle\AdminBundle\DependencyInjection\Compiler\TwigGlobalsPass;
22
use FSi\Bundle\AdminBundle\DependencyInjection\FSIAdminExtension;
23
use FSi\Bundle\AdminBundle\Finder\AdminClassFinder;
24
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
25
use Symfony\Component\DependencyInjection\ContainerBuilder;
26
use Symfony\Component\HttpKernel\Bundle\Bundle;
27
28
class FSiAdminBundle extends Bundle
29
{
30
    public function build(ContainerBuilder $container): void
31
    {
32
        parent::build($container);
33
34
        $container->addCompilerPass(new AdminAnnotatedElementPass(
0 ignored issues
show
Deprecated Code introduced by
The class FSi\Bundle\AdminBundle\D...minAnnotatedElementPass has been deprecated with message: since 3.0

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
35
            new AnnotationReader(),
36
            new AdminClassFinder()
0 ignored issues
show
Deprecated Code introduced by
The class FSi\Bundle\AdminBundle\Finder\AdminClassFinder has been deprecated with message: since 3.0

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
37
        ));
38
        $container->addCompilerPass(new AdminElementPass());
39
        $container->addCompilerPass(new KnpMenuBuilderPass());
40
        $container->addCompilerPass(new ResourceRepositoryPass());
41
        $container->addCompilerPass(new ManagerVisitorPass());
42
        $container->addCompilerPass(new ContextPass());
43
        $container->addCompilerPass(new TwigGlobalsPass());
44
    }
45
46
    public function getContainerExtension(): FSIAdminExtension
47
    {
48
        if (null === $this->extension) {
49
            $this->extension = new FSIAdminExtension();
50
        }
51
52
        return $this->extension;
53
    }
54
}
55