HomePhabricator

Add a linter rule for logical operators

Description

Add a linter rule for logical operators

Summary:
Ref T7409. Adds ArcanistXHPASTLinter::LINT_LOGICAL_OPERATORS for advising:

  • && in favor of and.
  • || in favor of or.

Based on Squiz_Sniffs_Operators_ValidLogicalOperatorsSniff.

Test Plan: Added test cases.

Reviewers: Blessed Reviewers, epriestley

Reviewed By: Blessed Reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7409

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

Details

Provenance
joshuaspenceAuthored on
joshuaspencePushed on Apr 12 2015, 9:38 PM
Reviewer
Blessed Reviewers
Differential Revision
D12376: Add a linter rule for logical operators
Parents
rARCfc70dfe268f8: Add a linter rule for self member references
Branches
Unknown
Tags
Unknown
Tasks
T7409: Implement PHPCS lints