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

PassportPackage::addToContainer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
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
}