Completed
Push — master ( 686b15...e1ff08 )
by Derek Stephen
08:48
created

UserPackage::addToContainer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1.2441

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 3
cts 8
cp 0.375
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 1
crap 1.2441
1
<?php
2
3
namespace Del;
4
5
use Del\Common\Container\RegistrationInterface;
6
use Del\Person\PersonPackage;
7
use Del\Service\UserService;
8
use Doctrine\ORM\EntityManager;
9
use Pimple\Container;
10
11
class UserPackage implements RegistrationInterface
12
{
13
    /**
14
     * @param Container $c
15
     */
16 25
    public function addToContainer(Container $c)
17
    {
18
        $personPackage = new PersonPackage();
19
        $personPackage->addToContainer($c);
20
21
        $function = function ($c) {
22 25
            $svc = new UserService($c);
23 25
            return $svc;
24
        };
25
26
        $c['service.user'] = $c->factory($function);
27
    }
28
29
    public function getEntityPath()
30
    {
31
        return 'vendor/delboy1978uk/user/src/Entity';
32
    }
33
34
    public function hasEntityPath()
35
    {
36
        return true;
37
    }
38
39
}