Passed
Push — master ( 5383f1...af8f48 )
by Gabriel
03:29
created

HasCurrentRouteTrait::setCurrent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 5
ccs 0
cts 3
cp 0
crap 2
rs 10
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