Passed
Push — development ( 4c608a...0dfecd )
by Alexander
04:55 queued 01:52
created

RouteTrait::getRoute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Trait for handling route set and get methods
4
 *
5
 * @file    RouteTrait.php
6
 *
7
 * PHP version 7.0+
8
 *
9
 * @author    Yancharuk Alexander <alex at itvault dot info>
10
 * @copyright © 2012-2018 Alexander Yancharuk
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\Traits;
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 4
	public function setRoute(Route $route)
32
	{
33 4
		$this->route = $route;
34
35 4
		return $this;
36
	}
37
38
	/**
39
	 * Get route object
40
	 *
41
	 * @return Route
42
	 */
43 2
	public function getRoute()
44
	{
45 2
		return $this->route;
46
	}
47
}
48