fix: reference amphp types by FQN in Promise @var#7
Closed
simPod wants to merge 2 commits into
Closed
Conversation
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.
f631c54 to
91343b7
Compare
Owner
Author
|
Superseded by upstream PR webonyx#1941. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GraphQL\Executor\Promise\PromiseimportsAmp\FutureandAmp\Promiseonly for the docblock@varunion on$adoptedPromise.amphp/amp v2 ships
Amp\Promiseand v3 shipsAmp\Future, so on any single installation one of the imported symbols is absent. Auseof 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
@varand drop the twouseimports.