Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| RegexIntegerSimple | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * @author: Doug Wilbourne (dougwilbourne@gmail.com) |
| 4 | * @version 1.0 |
| 5 | */ |
| 6 | |
| 7 | namespace pvc\regex\numeric; |
| 8 | |
| 9 | use pvc\regex\Regex; |
| 10 | |
| 11 | /** |
| 12 | * Class RegexIntegerSimple. Does not handle grouping separator, decimal separator, plus sign, etc. |
| 13 | |
| 14 | */ |
| 15 | class RegexIntegerSimple extends Regex |
| 16 | { |
| 17 | public function __construct() |
| 18 | { |
| 19 | $label = 'simple integers (no grouping separator or plus signs)'; |
| 20 | $pattern = '/^(0|\-?[1-9][0-9]*)$/'; |
| 21 | $this->setPattern($pattern); |
| 22 | $this->setLabel($label); |
| 23 | } |
| 24 | } |