Skip to content

[WP 5.3] Declaration should be compatible with Walker::walk #448

@Chouby

Description

@Chouby

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:

Declaration of `PLL_Walker_List::walk($elements, $max_depth, $args)` should be compatible with `Walker::walk($elements, $max_depth)`
(WordPressVIPMinimum.Classes.DeclarationCompatibility.DeclarationCompatibility)

The sniff should be adpated to the new method signature

Minimal Code Snippet

class PLL_Walker_List extends Walker {
	public function walk( $elements, $max_depth, ...$args ) {
		return parent::walk( $elements, $max_depth, $args );
	}
}

Tested Against master branch?

No but the code hasn't been modified for 5 months so cannot take this WP modification into account.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions