1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace GGGGino\SkuskuCartBundle; |
4
|
|
|
|
5
|
|
|
use Doctrine\Bundle\CouchDBBundle\DependencyInjection\Compiler\DoctrineCouchDBMappingsPass; |
|
|
|
|
6
|
|
|
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass; |
7
|
|
|
use Doctrine\Bundle\MongoDBBundle\DependencyInjection\Compiler\DoctrineMongoDBMappingsPass; |
|
|
|
|
8
|
|
|
use GGGGino\SkuskuCartBundle\DependencyInjection\Compiler\DoctrineRelatedPass; |
9
|
|
|
use GGGGino\SkuskuCartBundle\DependencyInjection\GGGGinoSkuskuCartExtension; |
10
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder; |
11
|
|
|
use Symfony\Component\HttpKernel\Bundle\Bundle; |
12
|
|
|
|
13
|
|
|
class GGGGinoSkuskuCartBundle extends Bundle |
14
|
|
|
{ |
15
|
|
|
public function build(ContainerBuilder $container) |
16
|
|
|
{ |
17
|
|
|
parent::build($container); |
18
|
|
|
|
19
|
|
|
$this->addRegisterMappingsPass($container); |
20
|
|
|
} |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* @param ContainerBuilder $container |
24
|
|
|
*/ |
25
|
|
|
private function addRegisterMappingsPass(ContainerBuilder $container) |
26
|
|
|
{ |
27
|
|
|
$modelNamespaces = array('GGGGino\SkuskuCartBundle\Model'); |
28
|
|
|
$modelPaths = array(realpath(__DIR__.'/Model')); |
29
|
|
|
|
30
|
|
|
if (class_exists('Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass')) { |
31
|
|
|
$container->addCompilerPass(DoctrineOrmMappingsPass::createAnnotationMappingDriver($modelNamespaces, $modelPaths)); |
32
|
|
|
} |
33
|
|
|
|
34
|
|
|
if (class_exists('Doctrine\Bundle\MongoDBBundle\DependencyInjection\Compiler\DoctrineMongoDBMappingsPass')) { |
35
|
|
|
$container->addCompilerPass(DoctrineMongoDBMappingsPass::createAnnotationMappingDriver($modelNamespaces, $modelPaths)); |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
if (class_exists('Doctrine\Bundle\CouchDBBundle\DependencyInjection\Compiler\DoctrineCouchDBMappingsPass')) { |
39
|
|
|
$container->addCompilerPass(DoctrineCouchDBMappingsPass::createAnnotationMappingDriver($modelNamespaces, $modelPaths)); |
40
|
|
|
} |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* Returns the bundle name that this bundle overrides. |
45
|
|
|
* |
46
|
|
|
* Despite its name, this method does not imply any parent/child relationship |
47
|
|
|
* between the bundles, just a way to extend and override an existing |
48
|
|
|
* bundle. |
49
|
|
|
* |
50
|
|
|
* @return string The Bundle name it overrides or null if no parent |
51
|
|
|
*/ |
52
|
|
|
public function getParent() |
53
|
|
|
{ |
54
|
|
|
return null; |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @inheritdoc |
59
|
|
|
*/ |
60
|
|
|
public function getContainerExtension() |
61
|
|
|
{ |
62
|
|
|
if (null === $this->extension) { |
63
|
|
|
$this->extension = new GGGGinoSkuskuCartExtension(); |
64
|
|
|
} |
65
|
|
|
return $this->extension; |
66
|
|
|
} |
67
|
|
|
} |
68
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths