HomePhabricator

Fix ArcanistPHPCloseTagXHPASTLinterRule always bailing out

Authored by asherkin on Jul 22 2017, 2:02 AM.

Description

Fix ArcanistPHPCloseTagXHPASTLinterRule always bailing out

Summary:
D13794 changed ArcanistPHPCloseTagXHPASTLinterRule to ignore inline HTML blocks, but selectDescendantsOfType returns an AASTNodeList (which always exists).

Instead, check that the count() of the node list is > 0.

empty.lint-test had to be changed, it wouldn't have been accepted had this rule not been broken before it was commited.

Added tests to cover ArcanistPHPCloseTagXHPASTLinterRule in the future.

Test Plan: arc unit

Reviewers: Blessed Reviewers, epriestley

Reviewed By: Blessed Reviewers, epriestley

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D18271