Test Setup Failed
Push — master ( ecdc34...0769f8 )
by Gabriel
02:46 queued 11s
created

HasCurrentRouteTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setCurrent() 0 6 1
A getCurrent() 0 4 1
1
<?php
2
3
namespace Nip\Router\Router\Traits;
4
5
use Nip\Router\Route\Route;
6
7
/**
8
 * Trait HasCurrentRouteTrait
9
 * @package Nip\Router\Router\Traits
10
 */
11
trait HasCurrentRouteTrait
12
{
13
14
    /**
15
     * @var Route
16
     */
17
    protected $route;
18
19
20
    /**
21
     * @param Route $route
22
     * @return $this
23
     */
24 12
    public function setCurrent($route)
25
    {
26 12
        $this->route = $route;
27
28 12
        return $this;
29
    }
30
31
    /**
32
     * @return Route
33
     */
34 2
    public function getCurrent()
35
    {
36 2
        return $this->route;
37
    }
38
}
39