Automattic / VIP-Coding-Standards

PHP_CodeSniffer ruleset to enforce WordPress VIP coding standards.
https://wpvip.com/documentation/how-to-install-php-code-sniffer-for-wordpress-com-vip/
Other
236 stars 40 forks source link

Classes/DeclarationCompatibility: remove redundant code #768

Closed jrfnl closed 1 year ago

jrfnl commented 1 year ago

The $functionList property is only ever written to, never read, so all that work walking all the tokens in the complete class scope is redundant (and was done in a highly inefficient way in the first place).

So, removing all code related to the property should improve performance of the sniff a little.

jrfnl commented 1 year ago

I wonder if this was meant to be used in a later development.

Quite possibly or a left-over of something removed.

I did try to do a trace back, but it came in with the initial import from SVN, so I couldn't trace the history back any further.