Conditions | 4 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
24 | 59 | public function __construct(string $origen, string $alEstarVacio = self::VACIO_PERMITE_TODO) |
|
25 | { |
||
26 | 59 | if ('' === $origen && self::VACIO_PERMITE_TODO === $alEstarVacio) { |
|
27 | // cualquier caracter no espaciado vertical, de 0 a N veces |
||
28 | 11 | $expresion = '\V*'; |
|
29 | } else { |
||
30 | 54 | $expresion = $origen; |
|
31 | } |
||
32 | 59 | $expresion = '/^' . $expresion . '$/u'; |
|
33 | 59 | if (! $this->expresionEsValida($expresion)) { |
|
34 | 5 | throw new PatronException($expresion); |
|
35 | } |
||
36 | |||
37 | 56 | $this->origen = $origen; |
|
38 | 56 | $this->expresion = $expresion; |
|
39 | 56 | $this->alEstarVacio = $alEstarVacio; |
|
40 | } |
||
74 |