-
Notifications
You must be signed in to change notification settings - Fork 40
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
[WP 5.3] Declaration should be compatible with Walker::walk
#448
Comments
Thanks for reporting @Chouby! Changed signature in Walker:walk(): WordPress/WordPress@38a8513 |
@Chouby Just a little heads-up, your code sample is bug-prone. The correct way to do it would be: class PLL_Walker_List extends Walker {
public function walk( $elements, $max_depth, ...$args ) {
return parent::walk( $elements, $max_depth, ...$args );
}
} Note the argument unpacking in the return statement. If you pass |
@jrfnl Thank you! This indeed could have been a bug. I removed most of the original code where at some point |
@Chouby No worries, I just pointed it out in hopes of preventing the issue getting into a real codebase (or others finding this snippet and using it blindly). |
Bug Description
PHP 5.6 or above
WP 5.3-beta3
VIPCS 2.0
WP 5.3 modified the signature of
Walker::walk()
. If we adapt our code to this new signature, we get an error:The sniff should be adpated to the new method signature
Minimal Code Snippet
Tested Against
master
branch?No but the code hasn't been modified for 5 months so cannot take this WP modification into account.
The text was updated successfully, but these errors were encountered: