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

HasCurrentRouteTrait::getCurrent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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