Skip to content
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

Prevent erroneous dropping of customPropertiesWhitelist array on ValidVariableName sniff #846

Conversation

westonruter
Copy link
Member

My PHPCS ruleset included:

<rule ref="WordPress.NamingConventions.ValidVariableName">
	<properties>
		<property name="customPropertiesWhitelist" type="array" value="textContent,nodeName,nodeValue" />
	</properties>
</rule>

Nevertheless, I was still getting flagged for code like:

'label' => $link->textContent,

I found that the conditions surrounding the retrieval of the customPropertiesWhitelist property were inadvertently dropping the value when it was defined properly as an array.

@grappler
Copy link
Member

@westonruter I think #841 will fix your issue once it is merged.

@jrfnl
Copy link
Member

jrfnl commented Feb 17, 2017

Marking this as a duplicate of #839 and partial duplicate to the more comprehensive #841.
@westonruter Could you please test with #841 ? That PR should fix these kind of issues for all sniffs merging custom lists.

@westonruter
Copy link
Member Author

👍 #841 fixes it.

@westonruter westonruter deleted the bugfix/prevent-dropping-custom-properties-whitelist branch February 19, 2017 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants