-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
feat: Add method annotations for methods that are callable via magic __call method
#2737
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
feat: Add method annotations for methods that are callable via magic __call method
#2737
Conversation
149e1ed to
7557625
Compare
7557625 to
69cb7c5
Compare
|
This is good. There are just a couple of general issues that need to be tweaked. The I don't know why, but And instead wants: I'm not sure what system you're using, but # On a macOS where PHP is installed with brew
find $(brew --prefix php@8.4)/ -name 'gen_stub.php'
/opt/homebrew/opt/php/lib/php/build/gen_stub.php
# On Linux
find $(php-config --extension-dir)/ -name 'gen_stub.php'
/usr/lib/php/20240924/build/gen_stub.phpAnd to run PHP 8.4's # Assuming you're on a mac. Use the php-config formulation otherwise
php $(find $(brew --prefix php@8.4)/ -name 'gen_stub.php') *.stub.php
In redis_cluster.stub.php:
RedisCluster::info(): @param doesn't contain a variable name or has an invalid format "string ...$sections Optional section(s) you wish Redis server to return."Note that each major.minor version of PHP updates I was able to work through the warnings pretty quickly. It was literally just making sure the The only other issue is that we can't change anything that isn't in a comment. Even changing cc @yatsukhnenko I'm fine with php-doc |
michael-grunder
left a comment
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.
Just what I mentioned in the previous comment.
7f6c917 to
0579686
Compare
|
hey @michael-grunder thanks for your feedback 👍 I reverted the method casing in |
@mitelg try to run |
0579686 to
8db2abf
Compare
|
hey @yatsukhnenko @michael-grunder I reverted the changes at the variadic parameters, as imo this is the wrong syntax writing it after the variable name. |
|
I then executed the |
That makes sense to me. It would be nice to be able to use consistent syntax both in the phpdoc and the actual stub prototypes. I assume the |
|
@michael-grunder unfortunately I have no knowledge about PHP internals 🙈 so I hope, it will be fixed with the issue I created. @yatsukhnenko done! |
|
Looks really good. I'll go over it this weekend and then get it merged. We're just about to release 6.3.0 GA so we may get this into 6.3.1 which will almost certainly come pretty quick after 6.3.0 |
|
FYI: I created a PR to support variadic syntax in the PHPDoc php/php-src#20342 |
c6a310f to
2281dfa
Compare
2281dfa to
175f173
Compare
|
I am unsure now, do I still need to execute |
|
It doesn't make any functional difference so you don't need to. I always do because I added a .git hook to tell me when they're out of sync 😄 |
michael-grunder
left a comment
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.
LGTM.
Completely safe to merge as well, since this doesn't change anything but the arginfo hashes
|
thanks for merging! |
The
RedisArrayclass is supporting the same method as the baseRedisclass via the magic__callmethod.To enable auto-completion and fixing static analyzer issues, I added
@methodannotations for all the methods that are not explicitly implemented.Also see discussion here: #2736
The class PHPdoc was generated with this script:
Executed in the root directory of this project.
RedisandRedisArraystub. Hope this changes are okay.Finally I fixed some PHPDoc comments in the stubs as they were not aligned with the actual types.