| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function getSolutions(Throwable $throwable): array |
||
| 33 | { |
||
| 34 | $file = file_get_contents($throwable->getFile()); |
||
| 35 | preg_match('/\>\>\>\>\>\>\> (.*?)\n/', $file, $matches); |
||
| 36 | $source = $matches[1]; |
||
| 37 | $folder = basename($throwable->getFile()); |
||
| 38 | $target = trim(`cd $folder; git branch | grep \* | cut -d ' ' -f2`); |
||
| 39 | |||
| 40 | return [ |
||
| 41 | BaseSolution::create("Merge conflict from branch '$source' into '$target'") |
||
| 42 | ->setSolutionDescription('You have a Git merge conflict. To undo your merge do `git reset --hard HEAD`'), |
||
| 43 | ]; |
||
| 44 | } |
||
| 45 | } |
||
| 46 |
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: