]> khamidou — GitHub mirrors - arcanist.git/commit
Add a linter rule for declaring nested functions
authorJoshua Spence <josh@joshuaspence.com>
Mon, 13 Apr 2015 20:29:44 +0000 (06:29 +1000)
committerJoshua Spence <josh@joshuaspence.com>
Mon, 13 Apr 2015 20:29:44 +0000 (06:29 +1000)
commite233b158f2e1b5610d2b6a9d0d4aeef22acc2540
treee4b600d3b751ada965699c73d5b330e26af11129
parent7bba30f66cee09f3f7303be7480d4f5584b09cab
Add a linter rule for declaring nested functions

Summary: Ref T7409. Adds `ArcanistXHPASTLinter::LINT_INNER_FUNCTION` to advise against declaring PHP functions within an outer function. Based on [[https://github.com/squizlabs/PHP_CodeSniffer/blob/master/CodeSniffer/Standards/Squiz/Sniffs/PHP/InnerFunctionsSniff.php | Squiz_Sniffs_PHP_InnerFunctionsSniff]].

Test Plan: Added unit tests.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T7409

Differential Revision: https://secure.phabricator.com/D12389
src/lint/linter/ArcanistXHPASTLinter.php
src/lint/linter/__tests__/xhpast/inner-function.lint-test [new file with mode: 0644]