Port MoodlePHPdoc check function types check - #227
Open
james-cnz wants to merge 1 commit into
Open
Conversation
james-cnz
force-pushed
the
phpdoc_types_test_2
branch
2 times, most recently
from
June 20, 2026 04:38
e778e57 to
ce11489
Compare
Author
|
I forgot about parentheses in types. |
james-cnz
force-pushed
the
phpdoc_types_test_2
branch
from
July 13, 2026 10:32
ce11489 to
f7ccfba
Compare
Author
|
I've made the type simplification aware of well-formedness of types. It doesn't make much difference now, but would make it easier to include a check that types are well-formed in the future, if desired. |
This was referenced Jul 14, 2026
james-cnz
force-pushed
the
phpdoc_types_test_2
branch
from
July 14, 2026 08:52
f7ccfba to
ca7b95c
Compare
Author
|
I forgot about the type "$this". |
james-cnz
force-pushed
the
phpdoc_types_test_2
branch
2 times, most recently
from
July 16, 2026 04:18
c99bc21 to
001b846
Compare
Author
|
I've improved subtype recognition a bit, to support, e.g. MDL-83375. |
james-cnz
force-pushed
the
phpdoc_types_test_2
branch
2 times, most recently
from
July 22, 2026 01:05
5470dc1 to
0ca7701
Compare
Author
|
Improved error messages a bit, to help address MDLSITE-3694. |
james-cnz
force-pushed
the
phpdoc_types_test_2
branch
from
August 4, 2026 00:43
0ca7701 to
2d25bd6
Compare
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.
This is a PHPDoc types check intended to be similar in scope to the MoodlePHPdoc check one.
It is a bit more permissive in a few respects:
But, AFAIK, it is only stricter in one way:
[EDIT: It looks like the existing checks fail to check PHPDocs that are separated from the function by an attribute, so it's also stricter in that way.]
As with the existing test, it makes no effort to syntax check types, check namespaces, match return types, or do any checking on variables.
And it passes existing tests.
So I don't think it should cause too much disruption.