| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function getSolutions(Throwable $throwable): array |
||
| 26 | { |
||
| 27 | preg_match(self::REGEX, $throwable->getMessage(), $matches); |
||
| 28 | |||
| 29 | $filePath = str_replace(app_path(), '', $throwable->getFile()); |
||
| 30 | $solution = new FixMissingSemicolonSolution($filePath, $throwable->getLine(), $matches[1]); |
||
| 31 | |||
| 32 | return $solution->isRunnable() |
||
| 33 | ? [$solution] |
||
| 34 | : []; |
||
| 35 | } |
||
| 36 | } |
||
| 37 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: