Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amp/Future Type mismatch due to humbug/box namespace prefix #29

Open
stijnbernards opened this issue Feb 25, 2025 · 1 comment
Open

Comments

@stijnbernards
Copy link

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? :)

@veewee
Copy link
Collaborator

veewee commented Feb 26, 2025

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants