RouterInjectingRepository   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 60%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 15
ccs 3
cts 5
cp 0.6
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setRouter() 0 5 1
A enrichEntityAtLoad() 0 4 1
1
<?php
2
3
namespace Kaliop\eZObjectWrapperBundle\Core\Traits;
4
5
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
6
7
trait RouterInjectingRepository
8
{
9
    protected $router;
10
11 10
    public function setRouter(UrlGeneratorInterface $router)
12
    {
13 10
        $this->router = $router;
14 10
        return $this; // fluent interfaces for setters
15
    }
16
17
    protected function enrichEntityAtLoad($entity)
18
    {
19
        return $entity->setRouter($this->router);
20
    }
21
}
22