Completed
Push — master ( 209cfa...3bc018 )
by Jacob
03:25
created

SiteRouter   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 29
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get_redirect_array() 0 7 1
A get_direct_array() 0 16 1
1
<?
0 ignored issues
show
Security Best Practice introduced by
It is not recommend to use PHP's short opening tag <?, better use <?php, or <?= in case of outputting.

Short opening tags are disabled in PHP’s default configuration. In such a case, all content of this file is output verbatim to the browser without being parsed, or executed.

As a precaution to avoid these problems better use the long opening tag <?php.

Loading history...
2
3
Loader::load('router', 'Router');
4
5
class SiteRouter extends Router
6
{
7
8
	protected function get_redirect_array()
9
	{
10
		return array(
11
			(object) array(
12
				'pattern' => '@/index.(html|htm|php)$@',
13
				'replace' => '/'));
14
	}
15
16
	protected function get_direct_array()
17
	{
18
		return array(
19
			(object) array(
20
				'match' => '/',
21
				'controller' => 'HomeController'),
22
			(object) array(
23
				'match' => '/terms/',
24
				'controller' => 'TermsController'),
25
			(object) array(
26
				'match' => '/change-log/',
27
				'controller' => 'ChangelogController'),
28
			(object) array(
29
				'match' => '/contact/',
30
				'controller' => 'ContactController'));
31
	}
32
33
}