Completed
Push — development ( c8333e...45a59f )
by Alexander
05:26
created

RouteTrait::getRoute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * Trait for handling route set and get methods
4
 *
5
 * @file    RouteTrait.php
6
 *
7
 * PHP version 5.4+
8
 *
9
 * @author    Yancharuk Alexander <alex at itvault dot info>
10
 * @copyright © 2012-2016 Alexander Yancharuk <alex at itvault at info>
11
 * @date      2016-01-15 18:25
12
 * @license   The BSD 3-Clause License
13
 *            <http://opensource.org/licenses/BSD-3-Clause>
14
 */
15
16
namespace Veles\Application;
17
18
use Veles\Routing\Route;
19
20
trait RouteTrait
21
{
22
    /** @var  Route */
23
    protected $route;
24
25
    /**
26
     * Set route object
27
     *
28
     * @param Route $route
29
     * @return $this
30
     */
31 2
    public function setRoute(Route $route)
32
    {
33 2
        $this->route = $route;
34
35 2
        return $this;
36
    }
37
38
    /**
39
     * Get route object
40
     *
41
     * @return Route
42
     */
43 1
    public function getRoute()
44
    {
45 1
        return $this->route;
46
    }
47
}
48