phpro / phpro/grumphp-shim

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

Open
#29 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
28
Forks
3
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with box.json and the TaskHandlerMiddlewareInterface and ConfigureDefaultIgnores.php signatures named in the error. Reproduce the failure while installing the grumphp-shim packages and inspect how namespace prefixing affects Amp\Future. Done means the custom middleware and packaged interface have compatible return types without the reported fatal error.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.