Passed
Push — master ( 0ee5ba...9ecbd5 )
by Alex
06:47
created

DateRouterType::searchRegExp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 1
1
<?php
2
namespace Mezon\Router\Types;
3
4
/**
5
 * Default date type for router
6
 *
7
 * @author gdever
8
 */
9
class DateRouterType
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 '(\[date:'.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-9]{4}-[0-9]{2}-[0-9]{2})';
30
    }
31
}
32