Completed
Push — 2.0 ( 143803...4e64fa )
by grégoire
08:42 queued 04:22
created

NumRange   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 22
rs 10

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
/**
13
 * NumRange
14
 *
15
 * Type for numerical ranges.
16
 *
17
 * @package Foundation
18
 * @copyright 2014 Grégoire HUBERT
19
 * @author Grégoire HUBERT
20
 * @license X11 {@link http://opensource.org/licenses/mit-license.php}
21
 */
22
class NumRange extends BaseRange
23
{
24
    /**
25
     * getRegexp
26
     *
27
     * @see BaseRange
28
     */
29
    protected function getRegexp()
30
    {
31
        return '/([\[\(])(-?[0-9\.]+), *(-?[0-9\.]+)([\]\)])/';
32
    }
33
34
    /**
35
     * getSubElement
36
     *
37
     * @see BaseRange
38
     */
39
    protected function getSubElement($element)
40
    {
41
        return $element + 0;
42
    }
43
}
44