These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace NVBooster\PHPCRAssetsBundle; |
||
4 | |||
5 | use Symfony\Component\HttpKernel\Bundle\Bundle; |
||
6 | use NVBooster\PHPCRAssetsBundle\DependencyInjection\NVBoosterPHPCRAssetsExtension; |
||
7 | use NVBooster\PHPCRAssetsBundle\DependencyInjection\Compiler\TwigFormThemePass; |
||
8 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
||
9 | use Doctrine\Bundle\PHPCRBundle\DependencyInjection\Compiler\DoctrinePhpcrMappingsPass; |
||
10 | |||
11 | /** |
||
12 | * @author nvb |
||
13 | * |
||
14 | */ |
||
15 | class NVBoosterPHPCRAssetsBundle extends Bundle |
||
16 | { |
||
17 | /** |
||
18 | * {@inheritDoc} |
||
19 | * |
||
20 | * @see \Symfony\Component\HttpKernel\Bundle\Bundle::getContainerExtension() |
||
21 | */ |
||
22 | public function getContainerExtension() |
||
23 | { |
||
24 | if (null === $this->extension) { |
||
25 | $this->extension = new NVBoosterPHPCRAssetsExtension(); |
||
26 | } |
||
27 | |||
28 | return $this->extension; |
||
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
![]() |
|||
29 | } |
||
30 | |||
31 | /** |
||
32 | * {@inheritDoc} |
||
33 | * |
||
34 | * @see \Symfony\Component\HttpKernel\Bundle\Bundle::build() |
||
35 | */ |
||
36 | public function build(ContainerBuilder $container) |
||
37 | { |
||
38 | parent::build($container); |
||
39 | |||
40 | if (class_exists('Doctrine\Bundle\PHPCRBundle\DependencyInjection\Compiler\DoctrinePhpcrMappingsPass')) { |
||
41 | $container->addCompilerPass( |
||
42 | DoctrinePhpcrMappingsPass::createXmlMappingDriver( |
||
43 | array( |
||
44 | realpath(__DIR__ . '/Resources/config/doctrine-phpcr') => 'NVBooster\PHPCRAssetsBundle\Asset', |
||
45 | ), |
||
46 | array('cmf_core.persistence.phpcr.manager_name'), |
||
47 | false, |
||
48 | array('NVBoosterPHPCRAssetsBundle' => 'NVBooster\PHPCRAssetsBundle\Asset') |
||
49 | ) |
||
50 | ); |
||
51 | |||
52 | $container->addCompilerPass(new TwigFormThemePass()); |
||
53 | } |
||
54 | } |
||
55 | } |
||
56 |