Completed
Push — master ( 2e845d...f1d84d )
by Derek Stephen
08:19
created

UserPackage::addToContainer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1.0109

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 7
cts 9
cp 0.7778
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 1
crap 1.0109
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 25
        $personPackage = new PersonPackage();
19 25
        $personPackage->addToContainer($c);
20
21 25
        $function = function ($c) {
22
            $svc = new UserService($c);
23
            return $svc;
24 25
        };
25
26 25
        $c['service.user'] = $c->factory($function);
27 25
    }
28
29 25
    public function getEntityPath()
30
    {
31 25
        return 'vendor/delboy1978uk/user/src/Entity';
32
    }
33
34 25
    public function hasEntityPath()
35
    {
36 25
        return true;
37
    }
38
39
}