| 1 | <?php |
||
| 10 | class MissingSemicolonSolutionProvider implements HasSolutionsForThrowable |
||
| 11 | { |
||
| 12 | protected const REGEX = "/syntax error, unexpected \'(.*?)\'(.*?);/"; |
||
| 13 | |||
| 14 | public function canSolve(Throwable $throwable): bool |
||
| 15 | { |
||
| 16 | if (! $throwable instanceof FatalThrowableError) { |
||
| 17 | return false; |
||
| 18 | } |
||
| 19 | preg_match(self::REGEX, $throwable->getMessage(), $matches); |
||
| 20 | |||
| 21 | if (isset($matches[1])) { |
||
| 22 | return true; |
||
| 23 | } |
||
| 24 | |||
| 25 | return false; |
||
| 26 | } |
||
| 27 | |||
| 28 | public function getSolutions(Throwable $throwable): array |
||
| 39 | } |
||
| 40 |