Completed
Push — master ( f3694f...a0e46b )
by Derek Stephen
03:04
created

Person   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A addToContainer() 0 8 1
1
<?php
2
/**
3
 * User: delboy1978uk
4
 * Date: 06/01/16
5
 * Time: 21:07
6
 */
7
8
namespace Del\Config\Container;
9
10
use Del\Common\Container\RegistrationInterface;
11
use Del\Repository\Person as PersonRepository;
12
use Doctrine\ORM\EntityManager;
13
use Pimple\Container;
14
15
class Person implements RegistrationInterface
16
{
17
    /**
18
     * @param Container $c
19
     */
20
    public function addToContainer(Container $c)
21
    {
22
        $c['repository.person'] = $c->factory(function ($c) {
23
            /** @var EntityManager $em */
24
            $em = $c['doctrine.entity_manager'];
25
            /** @var PersonRepository $repo */
26
            $repo = $em->getRepository('Del\Entity\Person');
27
            return $repo; });}
28
}