HasCurrentRouteTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 5
c 1
b 0
f 1
dl 0
loc 26
ccs 0
cts 5
cp 0
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setCurrent() 0 5 1
A getCurrent() 0 3 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
    public function setCurrent($route)
25
    {
26
        $this->route = $route;
27
28
        return $this;
29
    }
30
31
    /**
32
     * @return Route
33
     */
34
    public function getCurrent()
35
    {
36
        return $this->route;
37
    }
38
}
39