grumphp-shim
grumphp-shim copied to clipboard
Amp/Future Type mismatch due to humbug/box namespace prefix
Hello,
I tried creating a custom TaskHandlerMiddleware and use it together with the grumphp-shim packages.
But because TaskHandlerMiddlewareInterface return signature defines Amp\Future and this namespace is not excluded from humbug/box namespace prefixing I'm experiencing the following error:
Fatal error: Declaration of -\CodeQuality\GrumPHP\Runner\TaskHandler\Middleware\ConfigureDefaultIgnores::handle(GrumPHP\Task\TaskInterface $task, GrumPHP\Runner\TaskRunnerContext $runnerContext, GrumPHP\Runner\StopOnFailure $stopOnFailure, callable $next): Amp\Future must be compatible with GrumPHP\Runner\TaskHandler\Middleware\TaskHandlerMiddlewareInterface::handle(GrumPHP\Task\TaskInterface $task, GrumPHP\Runner\TaskRunnerContext $runnerContext, GrumPHP\Runner\StopOnFailure $stopOnFailure, callable $next): _HumbugBox6e20aa8b1e92\Amp\Future in /Users/-/Projects/-/vendor/-/code-quality/src/GrumPHP/Runner/TaskHandler/Middleware/ConfigureDefaultIgnores.php on line 28
Should the Amp\Future namespace be excluded in the box.json or am I doing something wrong? :)
Hello @stijnbernards
You are right, it's being scoped right now. Since it's part of the extendable public API, it should be ignored in box.json. (which might theoretically result in conflicts with any mismatching local amp installtion - but I can live with that)
Care to send a PR?