| Conditions | 4 |
| Paths | 5 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 54 | 5 | public function process(array $notations, string $value): array |
|
| 55 | { |
||
| 56 | 5 | if ($value === '') { |
|
| 57 | 1 | $notations[$this->name] = $this->default; |
|
| 58 | 1 | return $notations; |
|
| 59 | } |
||
| 60 | |||
| 61 | 4 | $matches = []; |
|
| 62 | 4 | $quoted = in_array($value[0], ['"', '\''], true) && |
|
| 63 | 4 | preg_match('/^(?|"((?:[^"]+|\\\\.)*)"|\'((?:[^\']+|\\\\.)*)\')/', $value, $matches); |
|
| 64 | |||
| 65 | 4 | $word = $quoted ? $matches[1] : str_before($value, ' '); |
|
| 66 | 4 | $notations[$this->name] = $word; |
|
| 67 | |||
| 68 | 4 | return $notations; |
|
| 69 | } |
||
| 71 |