RouteBase::setNotFoundException()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * Base class for routing
4
 *
5
 * @file      RouteBase.php
6
 *
7
 * PHP version 8.0+
8
 *
9
 * @author    Yancharuk Alexander <alex at itvault dot info>
10
 * @copyright © 2012-2021 Alexander Yancharuk
11
 * @date      2015-05-24 14:01
12
 * @license   The BSD 3-Clause License
13
 *            <https://tldrlegal.com/license/bsd-3-clause-license-(revised)>
14
 */
15
16
namespace Veles\Routing;
17
18
/**
19
 * Class RouteBase
20
 * @author  Yancharuk Alexander <alex at itvault dot info>
21
 */
22
class RouteBase
23
{
24
	/** @var  AbstractRoutesConfig */
25
	protected $config_handler;
26
	/** @var  string */
27
	protected $ex404 = '\Veles\Routing\Exceptions\NotFoundException';
28
29
	/**
30
	 * @return AbstractRoutesConfig
31
	 */
32 24
	public function getConfigHandler()
33
	{
34 24
		return $this->config_handler;
35
	}
36
37
	/**
38
	 * @param AbstractRoutesConfig $handler
39
	 *
40
	 * @return static
41
	 */
42 29
	public function setConfigHandler(AbstractRoutesConfig $handler)
43
	{
44 29
		$this->config_handler = $handler;
45
46 29
		return $this;
47
	}
48
49
	/**
50
	 * Set custom 404 exception class name
51
	 *
52
	 * @param string $ex404 Not Found exception class name
53
	 *
54
	 * @return static
55
	 */
56 1
	public function setNotFoundException($ex404)
57
	{
58 1
		$this->ex404 = $ex404;
59
60 1
		return $this;
61
	}
62
}
63