Make AbstractAnnotation::$_context non-nullable#2008
Merged
DerManoMann merged 2 commits intoApr 29, 2026
Conversation
The constructor guarantees `$_context` is always initialized to a non-null `Context` instance across all three branches. The nullable type was a leftover from the pre-native-type PHPDoc `@var Context|null`.
PHPStan correctly flags `!$annotation->_context` as always false now that `$_context` is typed as non-nullable `Context`.
DerManoMann
approved these changes
Apr 29, 2026
Collaborator
|
Thanks @krissss |
Contributor
|
Created backport PR for
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-2008-to-5.x
git worktree add --checkout .worktree/backport-2008-to-5.x backport-2008-to-5.x
cd .worktree/backport-2008-to-5.x
git reset --hard HEAD^
git cherry-pick -x ede7ae7d989edb272f73172d5c33e1476b8dba26 |
2 tasks
DerManoMann
added a commit
that referenced
this pull request
Apr 29, 2026
…able (#2009) --------- Co-authored-by: kriss <462679766@qq.com> Co-authored-by: DerManoMann <mano@radebatz.net>
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.
Closes #2007
Summary
AbstractAnnotation::$_contexttype from?ContexttoContextContextacross all three initialization branches@var Context|null, converted in Code cleanup #1947Test plan