MapperProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 23
ccs 0
cts 14
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 18 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Canvas\Providers;
6
7
use Phalcon\DiInterface;
0 ignored issues
show
Bug introduced by
The type Phalcon\DiInterface 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...
8
use Phalcon\Di\ServiceProviderInterface;
0 ignored issues
show
Bug introduced by
The type Phalcon\Di\ServiceProviderInterface 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...
9
use AutoMapperPlus\AutoMapper;
0 ignored issues
show
Bug introduced by
The type AutoMapperPlus\AutoMapper 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...
10
use AutoMapperPlus\Configuration\AutoMapperConfig;
0 ignored issues
show
Bug introduced by
The type AutoMapperPlus\Configuration\AutoMapperConfig 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...
11
12
class MapperProvider implements ServiceProviderInterface
13
{
14
    /**
15
     * @param DiInterface $container
16
     */
17
    public function register(DiInterface $container)
18
    {
19
        //configure the dto config
20
        $container->setShared(
21
            'dtoConfig',
22
            function () {
23
                $config = new AutoMapperConfig();
24
                $config->getOptions()->dontSkipConstructor();
25
        
26
                return $config;
27
            }
28
        );
29
30
        //configure the dto mapper
31
        $container->set(
32
            'mapper',
33
            function () use ($container) {
34
                return new AutoMapper($container->get('dtoConfig'));
35
            }
36
        );
37
    }
38
}
39