]> khamidou — GitHub mirrors - arcanist.git/commit
Add a linter rule for curly brace array indexes
authorJoshua Spence <josh@freelancer.com>
Tue, 8 Dec 2015 19:56:48 +0000 (06:56 +1100)
committerJoshua Spence <josh@freelancer.com>
Tue, 8 Dec 2015 20:16:12 +0000 (07:16 +1100)
commitd2e7785497279e31c635d1457c863b49c3a492ed
tree9db5c8280525e0db4d03cd338bed33178652e9fd
parenta6e81daad1bbd470c1907a7ea705b2e084fc07dd
Add a linter rule for curly brace array indexes

Summary: In PHP, both `$x['key']` and `$x{'key'}` can be used to access an array (see  http://stackoverflow.com/questions/8092248/php-curly-braces-in-array-notation), but the former should be preferred.

Test Plan: Added test cases.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14603
src/__phutil_library_map__.php
src/lint/linter/xhpast/rules/ArcanistCurlyBraceArrayIndexXHPASTLinterRule.php [new file with mode: 0644]
src/lint/linter/xhpast/rules/__tests__/ArcanistCurlyBraceArrayIndexXHPASTLinterRuleTestCase.php [new file with mode: 0644]
src/lint/linter/xhpast/rules/__tests__/curly-brace-array-index/array.lint-test [new file with mode: 0644]
src/lint/linter/xhpast/rules/__tests__/curly-brace-array-index/nested.lint-test [new file with mode: 0644]
src/lint/linter/xhpast/rules/__tests__/curly-brace-array-index/whitespace.lint-test [new file with mode: 0644]