Completed
Push — master ( 369737...64c6ea )
by Alex
07:19
created

IntegerRouterType::handle()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 8
rs 10
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