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( |
|
|
|
|
35
|
|
|
new AnnotationReader(), |
36
|
|
|
new AdminClassFinder() |
|
|
|
|
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
|
|
|
|