Page MenuHomePhabricator

Add a linter rule for parentheses being used with PHP language constructs
Closed, ResolvedPublic

Description

PHP has various language constructs such as echo and require which can be called with or without parentheses. For example, echo "Foo"; and echo("Foo"); are equivalent. We should add a linter rule to ArcanistXHPASTLinter which favors the parenthesis being omitted.

Revisions and Commits

Restricted Differential Revision

Event Timeline

joshuaspence claimed this task.
joshuaspence raised the priority of this task from to Needs Triage.
joshuaspence triaged this task as Wishlist priority.
joshuaspence updated the task description. (Show Details)
joshuaspence added a project: Arcanist.
joshuaspence added a subscriber: joshuaspence.

My favorite is exit:

$ php -r 'echo strlen("quack" + exit);'
joshuaspence added a revision: Restricted Differential Revision.Aug 2 2014, 9:54 AM
joshuaspence added a commit: Restricted Diffusion Commit.

Closed by commit rARCf6e26a71335e.