Page MenuHomePhabricator

Add a linter rule for declaring nested functions
ClosedPublic

Authored by joshuaspence on Apr 13 2015, 10:50 AM.
Tags
None
Referenced Files
F18818383: D12389.id29784.diff
Oct 22 2025, 12:02 AM
F18805693: D12389.id.diff
Oct 18 2025, 4:10 PM
F18778524: D12389.diff
Oct 11 2025, 9:48 AM
F18741026: D12389.id29784.diff
Oct 2 2025, 7:36 AM
F18738213: D12389.id29737.diff
Oct 1 2025, 2:49 PM
F18714587: D12389.id.diff
Sep 29 2025, 8:13 AM
F18626849: D12389.diff
Sep 16 2025, 2:38 AM
F18624424: D12389.id29735.diff
Sep 15 2025, 7:59 PM
Subscribers

Details

Summary

Ref T7409. Adds ArcanistXHPASTLinter::LINT_INNER_FUNCTION to advise against declaring PHP functions within an outer function. Based on Squiz_Sniffs_PHP_InnerFunctionsSniff.

Test Plan

Added unit tests.

Diff Detail

Repository
rARC Arcanist
Branch
master
Lint
Lint Passed
Unit
Test Failures
Build Status
Buildable 5281
Build 5299: [Placeholder Plan] Wait for 30 Seconds

Unit TestsFailed

TimeTest
9,286 msArcanistXHPASTLinterTestCase::testLinter
823 msArcanistCSSLintLinterTestCase::testLinter
151 msArcanistCSSLintLinterTestCase::testVersion
131 msArcanistChmodLinterTestCase::testLinter
247 msArcanistClosureLinterTestCase::testLinter
View Full Test Results (1 Failed · 46 Passed · 6 Skipped)

Event Timeline

joshuaspence retitled this revision from to Add a linter rule for declaring nested functions.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
joshuaspence edited edge metadata.

Better detection of closures

epriestley edited edge metadata.

"Rocks are heavy and rigid. Avoid hitting yourself in the face with a rock."

This revision is now accepted and ready to land.Apr 13 2015, 2:27 PM
This revision was automatically updated to reflect the committed changes.