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

TsRangeChronos   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 22
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getRegexp() 0 4 1
A getSubElement() 0 4 1
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