IntegerRouterType   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A parserRegExp() 0 3 1
A searchRegExp() 0 3 1
1
<?php
2
namespace Mezon\Router\Types;
3
4
/**
5
 * Default integer type for router
6
 *
7
 * @author gdever
8
 */
9
class IntegerRouterType
10
{
11
12
    /**
13
     * Method returns regexp for searching
14
     *
15
     * @return string regexp for searching
16
     */
17
    public static function searchRegExp(): string
18
    {
19
        return '(\[i:'.BaseType::PARAMETER_NAME_REGEXP.'+\])';
20
    }
21
22
    /**
23
     * Method returns regexp for parsing
24
     *
25
     * @return string regexp for parsing
26
     */
27
    public static function parserRegExp(): string
28
    {
29
        return '[-+]{0,1}[0-9]+';
30
    }
31
}
32