Completed
Push — master ( e7d3f8...bbd5c2 )
by Derek Stephen
01:35
created

UserPackage   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 30
ccs 0
cts 18
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A addToContainer() 0 14 1
A getEntityPath() 0 4 1
A hasEntityPath() 0 4 1
1
<?php
2
3
namespace Del;
4
5
use Del\Common\Container\RegistrationInterface;
6
use Del\Person\PersonPackage;
7
use Del\Person\Service\PersonService;
8
use Del\Service\UserService;
9
use Barnacle\Container;
10
use Doctrine\ORM\EntityManager;
11
12
class UserPackage implements RegistrationInterface
13
{
14
    /**
15
     * @param Container $c
16
     */
17
    public function addToContainer(Container $c): void
18
    {
19
        $personPackage = new PersonPackage();
20
        $personPackage->addToContainer($c);
21
22
        $function = function (Container $c) {
23
            $entityManager = $c->get(EntityManager::class);
24
            $personService = $c->get(PersonService::class);
25
26
            return new UserService($entityManager, $personService);
27
        };
28
29
        $c[UserService::class] = $c->factory($function);
30
    }
31
32
    public function getEntityPath(): string
33
    {
34
        return 'vendor/delboy1978uk/user/src/Entity';
35
    }
36
37
    public function hasEntityPath(): bool
38
    {
39
        return true;
40
    }
41
}
42