Completed
Push — master ( 72b000...20c83d )
by Derek Stephen
02:27
created

PassportPackage   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 22
ccs 0
cts 10
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A addToContainer() 0 8 1
A getEntityPath() 0 4 1
1
<?php
2
3
namespace Del\Passport;
4
5
use Barnacle\Container;
6
use Barnacle\EntityRegistrationInterface;
7
use Barnacle\RegistrationInterface;
8
use Doctrine\ORM\EntityManager;
9
10
class PassportPackage implements RegistrationInterface, EntityRegistrationInterface
11
{
12
    /**
13
     * @param Container $c
14
     */
15
    public function addToContainer(Container $c)
16
    {
17
        $c[PassportControl::class] = $c->factory(function(Container $c) {
18
            $em = $c->get(EntityManager::class);
19
20
            return new PassportControl($em);
21
        });
22
    }
23
24
    /**
25
     * @return string
26
     */
27
    function getEntityPath(): string
28
    {
29
        return __DIR__ . '/Entity';
30
    }
31
}