RouteStatic   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 4
dl 0
loc 14
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A check() 0 5 3
1
<?php
2
/**
3
 * Handler for processing static routes
4
 *
5
 * @file      RouteStatic.php
6
 *
7
 * PHP version 8.0+
8
 *
9
 * @author    Alexander Yancharuk <alex at itvault dot info>
10
 * @copyright © 2012-2021 Alexander Yancharuk
11
 * @date      Сбт Июн 23 10:42:18 2012
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 RouteStatic
20
 * @author  Alexander Yancharuk <alex at itvault dot info>
21
 */
22
class RouteStatic implements RouteStrategyInterface
23
{
24
	/**
25
	 * Check for matching url to pattern
26
	 *
27
	 * @param string $pattern
28
	 * @param string $url
29
	 * @return bool
30
	 */
31 16
	public static function check($pattern, $url)
32
	{
33 16
		return $pattern === $url
34 16
			|| $pattern . 'index.php'  === $url
35 16
			|| $pattern . '/index.php' === $url;
36
	}
37
}
38