Issues (51)

FSiAdminBundle.php (2 issues)

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: since 3.0 ( Ignorable by Annotation )

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

34
        $container->addCompilerPass(/** @scrutinizer ignore-deprecated */ new AdminAnnotatedElementPass(
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: since 3.0 ( Ignorable by Annotation )

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

36
            /** @scrutinizer ignore-deprecated */ new AdminClassFinder()
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