Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13994101
D14615.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D14615.diff
View Options
diff --git a/src/lint/linter/xhpast/rules/ArcanistParenthesesSpacingXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistParenthesesSpacingXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistParenthesesSpacingXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistParenthesesSpacingXHPASTLinterRule.php
@@ -18,10 +18,11 @@
'n_ARRAY_VALUE_LIST',
'n_ASSIGNMENT_LIST',
'n_CALL_PARAMETER_LIST',
- 'n_DECLARATION_PARAMETER_LIST',
'n_CONTROL_CONDITION',
+ 'n_DECLARATION_PARAMETER_LIST',
'n_FOR_EXPRESSION',
'n_FOREACH_EXPRESSION',
+ 'n_LEXICAL_VARIABLE_LIST',
));
foreach ($all_paren_groups as $group) {
diff --git a/src/lint/linter/xhpast/rules/ArcanistVariableReferenceSpacingXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistVariableReferenceSpacingXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistVariableReferenceSpacingXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistVariableReferenceSpacingXHPASTLinterRule.php
@@ -24,7 +24,9 @@
if ($before) {
$this->raiseLintAtOffset(
head($before)->getOffset(),
- pht('Variable references should not be prefixed with whitespace.'),
+ pht(
+ 'For consistency, variable references should not be '.
+ 'prefixed with whitespace.'),
implode('', mpull($before, 'getValue')),
'');
}
diff --git a/src/lint/linter/xhpast/rules/__tests__/parentheses-spacing/closure.lint-test b/src/lint/linter/xhpast/rules/__tests__/parentheses-spacing/closure.lint-test
new file mode 100644
--- /dev/null
+++ b/src/lint/linter/xhpast/rules/__tests__/parentheses-spacing/closure.lint-test
@@ -0,0 +1,12 @@
+<?php
+
+$x = function ( $y) use ( $z) {
+ return $y + $z;
+};
+~~~~~~~~~~
+warning:3:16
+warning:3:26
+~~~~~~~~~~
+$x = function ($y ) use ($z ) {
+ return $y + $z;
+};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Oct 24, 3:48 AM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6745765
Default Alt Text
D14615.diff (1 KB)
Attached To
Mode
D14615: Include `n_LEXICAL_VARIABLE_LIST` in parentheses spacing linter rule
Attached
Detach File
Event Timeline
Log In to Comment