Closed ajourquin closed 1 year ago
Hello,
Argument #1 ($task) must be of type GrumPHP\Task\TaskInterface, __PHP_Incomplete_Class given... called in laravel-serializable-closure://static function
When using the parallel mode, the task is being serialized by the laravel/serializable-closure package.
As you can see, the result is of type __PHP_Incomplete_Class
.
This is a special internal class that indicates that PHP was not able to unserialize the serialized version back into a valid PHP class. Most of the time, this is because of an autoloading issue or optionally an issue in your PHP INI configuration.
More info: https://www.php.net/manual/en/function.unserialize.php
You could start debugging the core of the issue here: https://github.com/phpro/grumphp/blob/master/src/Runner/TaskHandler/Middleware/ParallelProcessingMiddleware.php#L64
Thanks for the input, i'll take a look
Actually, when you install grumphp locally in your project and run it from vendor/bin/grumphp it works fine.
./vendor/bin/grumphp run
When you run grumphp from a global installation it's not working
grumphp run
I don't have a clue at the moment. Most of this is how it works internal in amp/parallel. For grumphp global we do load multiple composer autoload files in order to be able to load both project and global classes. So maybe something goes wrong somewhere in there; but I honestly don't know how amp/parallel deals with autoloaders.
Closing because of inactivity. Feel free to reopen if this is still blocking you.
My configuration
Vendor\Grumphp\Tasks\ComposerAudit.php - basically the same content as GrumPHP\Task\Composer.php
Steps to reproduce:
Result:
Expected Result:
Note: When 'parallel' option is enabled an error occur. When 'parallel' option is disabled it works correctly.