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 |
This error could be the result of:
1. Missing dependencies
PHP Analyzer uses your
composer.json
file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects thecomposer.json
to be in the root folder of your repository.Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the
require
orrequire-dev
section?2. Missing use statement
PHP does not complain about undefined classes in
ìnstanceof
checks. For example, the following PHP code will work perfectly fine:If you have not tested against this specific condition, such errors might go unnoticed.