Passed
Pull Request — master (#57)
by Matthew
15:03
created

ContainerExtended   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 27
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getDoctrine_Orm_DefaultEntityManagerService() 0 23 2
1
<?php
2
3
namespace Dtc\QueueBundle\Tests\ORM;
4
5
use Doctrine\ORM\EntityManager;
6
use Symfony\Component\DependencyInjection\Container;
7
use Doctrine\ORM\Tools\Setup;
8
9
class ContainerExtended extends Container
10
{
11
    protected $methodMap = ['doctrine.orm.default_entity_manager' => 'getDoctrine_Orm_DefaultEntityManagerService'];
12
13
    public function getDoctrine_Orm_DefaultEntityManagerService($something = false)
0 ignored issues
show
Unused Code introduced by
The parameter $something is not used and could be removed. ( Ignorable by Annotation )

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

13
    public function getDoctrine_Orm_DefaultEntityManagerService(/** @scrutinizer ignore-unused */ $something = false)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
14
    {
15
        $config = Setup::createAnnotationMetadataConfiguration(array(__DIR__.'/../..'), true, null, null, false);
16
        $namingStrategy = new \Doctrine\ORM\Mapping\UnderscoreNamingStrategy();
17
        $config->setNamingStrategy($namingStrategy);
18
        $config->addCustomNumericFunction('year', Year::class);
0 ignored issues
show
Bug introduced by
The type Dtc\QueueBundle\Tests\ORM\Year 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...
19
        $config->addCustomNumericFunction('month', Month::class);
0 ignored issues
show
Bug introduced by
The type Dtc\QueueBundle\Tests\ORM\Month 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...
20
        $config->addCustomNumericFunction('day', Day::class);
0 ignored issues
show
Bug introduced by
The type Dtc\QueueBundle\Tests\ORM\Day 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...
21
        $config->addCustomNumericFunction('hour', Hour::class);
0 ignored issues
show
Bug introduced by
The type Dtc\QueueBundle\Tests\ORM\Hour 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...
22
        $config->addCustomNumericFunction('minute', Minute::class);
0 ignored issues
show
Bug introduced by
The type Dtc\QueueBundle\Tests\ORM\Minute 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...
23
        $host = getenv('MYSQL_HOST');
24
        $user = getenv('MYSQL_USER');
25
        $port = getenv('MYSQL_PORT') ?: 3306;
26
        $password = getenv('MYSQL_PASSWORD');
27
        $db = getenv('MYSQL_DATABASE');
28
        $params = ['host' => $host,
29
            'port' => $port,
30
            'user' => $user,
31
            'driver' => 'mysqli',
32
            'password' => $password,
33
            'dbname' => $db, ];
34
35
        return EntityManager::create($params, $config);
36
    }
37
}
38