| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | 9 | public function process(array $notations, string $value): array |
|
| 24 | { |
||
| 25 | 9 | $regexp = '/^(?<location>(?:[^"]\S*|"[^"]+"))(?:\s*(?<start_line>\d+)' |
|
| 26 | 9 | . '(?:\s*(?<number_of_lines>\d+))?)?(?:\s*(?<description>.+))?/'; |
|
| 27 | |||
| 28 | 9 | if (!preg_match($regexp, $value, $matches)) { |
|
| 29 | 2 | throw new PhpdocException("Failed to parse '@{$this->name} $value': invalid syntax"); |
|
| 30 | } |
||
| 31 | |||
| 32 | 7 | $this->normalizeValues($matches); |
|
| 33 | 7 | $matches = array_only($matches, ['location', 'start_line', 'number_of_lines', 'description']); |
|
| 34 | |||
| 35 | 7 | $notations[$this->name] = $matches; |
|
| 36 | |||
| 37 | 7 | return $notations; |
|
| 38 | } |
||
| 62 |