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