| Conditions | 7 |
| Paths | 7 |
| Total Lines | 17 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | public function toRegex(TypePattern $typePattern) |
||
| 10 | { |
||
| 11 | switch ($typePattern->getType()) { |
||
| 12 | case 'string': |
||
| 13 | case 'wildcard': |
||
| 14 | case '*': |
||
| 15 | return "(.+)"; |
||
| 16 | case 'number': |
||
| 17 | return "(\\-?[0-9]*[\\.|\\,]?[0-9]*)"; |
||
| 18 | case 'integer': |
||
| 19 | return "(\\-?[0-9]*)"; |
||
| 20 | case 'double': |
||
| 21 | return "(\\-?[0-9]*[\\.|\\,][0-9]*)"; |
||
| 22 | default: |
||
| 23 | throw new UnknownTypeException($typePattern->getType()); |
||
| 24 | } |
||
| 25 | } |
||
| 26 | } |
||
| 27 |