Skip to content

fix: reference amphp types by FQN in Promise @var#7

Closed
simPod wants to merge 2 commits into
masterfrom
fix/amp-promise-fqn
Closed

fix: reference amphp types by FQN in Promise @var#7
simPod wants to merge 2 commits into
masterfrom
fix/amp-promise-fqn

Conversation

@simPod

@simPod simPod commented Jul 4, 2026

Copy link
Copy Markdown
Owner

GraphQL\Executor\Promise\Promise imports Amp\Future and Amp\Promise only for the docblock @var union on $adoptedPromise.

amphp/amp v2 ships Amp\Promise and v3 ships Amp\Future, so on any single installation one of the imported symbols is absent. A use of a missing class breaks static analysis (PHPStan: "Class Amp\Promise was not found while discovering symbols") for consumers whose code touches this class.

Reference the amphp types by fully-qualified name in the @var and drop the two use imports.

simPod added 2 commits July 4, 2026 11:40
Promise imported `Amp\Future` and `Amp\Promise` solely for the docblock `@var`
union. amphp/amp v2 ships `Amp\Promise` and v3 ships `Amp\Future`, so on any
single install one imported symbol is absent, and a `use` of a missing class
breaks static analysis.

Reference the amphp types by fully-qualified name in the `@var` and drop the
imports.
@simPod simPod force-pushed the fix/amp-promise-fqn branch from f631c54 to 91343b7 Compare July 4, 2026 09:43
@simPod

simPod commented Jul 4, 2026

Copy link
Copy Markdown
Owner Author

Superseded by upstream PR webonyx#1941.

@simPod simPod closed this Jul 4, 2026
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

Successfully merging this pull request may close these issues.

1 participant