Issues (13)

src/DoyoUserBundle.php (2 issues)

Labels
Severity
1
<?php
2
3
/*
4
 * This file is part of the DoyoUserBundle project.
5
 *
6
 * (c) Anthonius Munthi <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Doyo\UserBundle;
15
16
use Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass;
17
use Doyo\UserBundle\Bridge\ApiPlatform\UserResourcePass;
18
use Doyo\UserBundle\DependencyInjection\Compiler\ValidationPass;
19
use Symfony\Component\DependencyInjection\ContainerBuilder;
20
use Symfony\Component\HttpKernel\Bundle\Bundle;
21
22
class DoyoUserBundle extends Bundle
23
{
24
    public function build(ContainerBuilder $container)
25
    {
26
        parent::build($container);
27
        $container->addCompilerPass(new ValidationPass());
28
        $container->addCompilerPass(new UserResourcePass());
29
        $this->addRegisterMappingPass($container);
30
    }
31
32
    private function addRegisterMappingPass(ContainerBuilder $container)
33
    {
34
        $mappings = [
35
            realpath(__DIR__.'/Resources/config/doctrine-mapping') => 'Doyo\UserBundle\Model',
36
        ];
37
38
        if (class_exists('Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DoctrineOrmMappingsPass')) {
39
            $container->addCompilerPass(
40
                DoctrineOrmMappingsPass::createXmlMappingDriver($mappings, ['doyo_user.model_manager_name'], 'doyo_user.backend_type_orm')
41
            );
42
        }
43
44
        if (class_exists('Doctrine\Bundle\MongoDBBundle\DependencyInjection\Compiler\DoctrineMongoDBMappingsPass')) {
45
            $container->addCompilerPass(DoctrineMongoDBMappingsPass::createXmlMappingDriver($mappings, ['doyo_user.model_manager_name'], 'doyo_user.backend_type_mongodb'));
0 ignored issues
show
The type Doyo\UserBundle\DoctrineMongoDBMappingsPass was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
46
        }
47
48
        if (class_exists('Doctrine\Bundle\CouchDBBundle\DependencyInjection\Compiler\DoctrineCouchDBMappingsPass')) {
49
            $container->addCompilerPass(DoctrineCouchDBMappingsPass::createXmlMappingDriver($mappings, ['doyo_user.model_manager_name'], 'doyo_user.backend_type_couchdb'));
0 ignored issues
show
The type Doyo\UserBundle\DoctrineCouchDBMappingsPass was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
50
        }
51
    }
52
}
53