Add support for PHP 8.3 typed class constants#4085
Merged
jaapio merged 2 commits intophpDocumentor:masterfrom Apr 10, 2026
Merged
Add support for PHP 8.3 typed class constants#4085jaapio merged 2 commits intophpDocumentor:masterfrom
jaapio merged 2 commits intophpDocumentor:masterfrom
Conversation
Pass the native type from PHP 8.3 typed class constants through to the ConstantDescriptor, following the same approach used by PropertyAssembler. Requires phpdocumentor/reflection with typed constant support.
Member
|
Thanks, I released phpdocumentor/reflection 6.5.0 you can update this version here to make the pipeline pass. |
Reflection 6.5.0 includes typed class constants support, which this PR depends on.
jaapio
approved these changes
Apr 10, 2026
Member
|
Very nice, thanks for your help. I will try to prepare a new release soon. |
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.
Summary
Wire the native type from PHP 8.3 typed class constants into the
ConstantDescriptor, so it is available for rendering in templates.Constantto the descriptor inConstantAssembler, following the same pattern used byPropertyAssemblernode.typefor constants, so typed constants will render their native type automaticallyWhen a native type is present, it takes precedence over
@vardocblock annotations (consistent with how PHP itself treats type declarations).Depends on phpDocumentor/Reflection#736.
Fixes #3721