-
-
Notifications
You must be signed in to change notification settings - Fork 20
Add additional parameter and return type information to stubs #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
szepeviktor
merged 16 commits into
php-stubs:master
from
johnbillion:additional-parameters
Mar 24, 2022
Merged
Add additional parameter and return type information to stubs #28
szepeviktor
merged 16 commits into
php-stubs:master
from
johnbillion:additional-parameters
Mar 24, 2022
Conversation
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
I'd like to distance myself from WordPress and web frameworks, web applications - but cannot! I welcome your contributions. |
szepeviktor
reviewed
Mar 24, 2022
szepeviktor
reviewed
Mar 24, 2022
functionMap.php
Outdated
* This array is in the same format as the stubs array in PHPStan: | ||
* This array is in the same format as the function map array in PHPStan: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️ This is my kind of commit 😍
szepeviktor
reviewed
Mar 24, 2022
Almost done 🚀 |
szepeviktor
approved these changes
Mar 24, 2022
Thank you John. |
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 introduces some more functionality to the node visitor which appends PHPStan-specific
@phpstan-param
and@phpstan-return
tags to the docblock for given functions and methods.This allows for us to increase the specificity of return values and parameters for PHPStan usage specifically.
The
functionMap.php
file is formatted in a similar manner to the same file in PHPStan itself. Any number of functions and methods can be added in order to override the return type and zero or more of its parameter types.The resulting changes for the functions and methods I've added so far can be seen in
wordpress-stubs.php
.@szepeviktor What do you think?
This relies on php-stubs/generator#13