Completed
Pull Request — master (#81)
by
unknown
04:08
created

TsRangeChronos::getRegexp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/*
3
 * This file is part of PommProject's Foundation package.
4
 *
5
 * (c) 2014 Grégoire HUBERT <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace PommProject\Foundation\Converter\Type;
11
12
use Cake\Chronos\Chronos;
13
14
/**
15
 * TsRangeChronos
16
 *
17
 * Type for range of timestamps.
18
 *
19
 * @package Foundation
20
 * @copyright 2017 Grégoire HUBERT
21
 * @author Miha Vrhovnik
22
 * @license X11 {@link http://opensource.org/licenses/mit-license.php}
23
 */
24
class TsRangeChronos extends BaseRange
25
{
26
    /**
27
     * getRegexp
28
     *
29
     * @see BaseRange
30
     */
31
    protected function getRegexp()
32
    {
33
        return '/([\[\(])"?([0-9 :+\.-]+)"?, *"?([0-9 :+\.-]+)"?([\]\)])/';
34
    }
35
36
    /**
37
     * getSubElement
38
     *
39
     * @see BaseRange
40
     */
41
    protected function getSubElement($element)
42
    {
43
        return new Chronos($element);
44
    }
45
}
46