Page MenuHomePhabricator

D14489.diff
No OneTemporary

D14489.diff

diff --git a/src/lint/linter/xhpast/rules/ArcanistArrayCombineXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistArrayCombineXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistArrayCombineXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistArrayCombineXHPASTLinterRule.php
@@ -6,7 +6,7 @@
const ID = 84;
public function getLintName() {
- return pht('%s Unreliable', 'array_combine()');
+ return pht('`%s` Unreliable', 'array_combine()');
}
public function getLintSeverity() {
@@ -35,8 +35,8 @@
'Prior to PHP 5.4, `%s` fails when given empty arrays. '.
'Prefer to write `%s` as `%s`.',
'array_combine()',
- 'array_combine(x, x)',
- 'array_fuse(x)'));
+ 'array_combine($x, $x)',
+ 'array_fuse($x)'));
}
}
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistClassExtendsObjectXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistClassExtendsObjectXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistClassExtendsObjectXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistClassExtendsObjectXHPASTLinterRule.php
@@ -6,7 +6,7 @@
const ID = 88;
public function getLintName() {
- return pht('Class Not Extending %s', 'Phobject');
+ return pht('Class Not Extending `%s`', 'Phobject');
}
public function getLintSeverity() {
@@ -29,8 +29,8 @@
$this->raiseLintAtNode(
$class,
pht(
- 'Classes should extend from %s or from some other class. '.
- 'All classes (except for %s itself) should have a base class.',
+ 'Classes should extend from `%s` or from some other class. '.
+ 'All classes (except for `%s` itself) should have a base class.',
'Phobject',
'Phobject'));
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistClassFilenameMismatchXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistClassFilenameMismatchXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistClassFilenameMismatchXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistClassFilenameMismatchXHPASTLinterRule.php
@@ -47,7 +47,7 @@
$decl_name,
pht(
"The name of this file differs from the name of the ".
- "class or interface it declares. Rename the file to '%s'.",
+ 'class or interface it declares. Rename the file to `%s`.',
$rename));
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistClassNameLiteralXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistClassNameLiteralXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistClassNameLiteralXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistClassNameLiteralXHPASTLinterRule.php
@@ -39,7 +39,7 @@
$this->raiseLintAtNode(
$string,
pht(
- "Don't hard-code class names, use %s instead.",
+ "Don't hard-code class names, use `%s` instead.",
'__CLASS__'),
$replacement);
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistCommentStyleXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistCommentStyleXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistCommentStyleXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistCommentStyleXHPASTLinterRule.php
@@ -19,7 +19,10 @@
$this->raiseLintAtOffset(
$comment->getOffset(),
- pht('Use "%s" single-line comments, not "%s".', '//', '#'),
+ pht(
+ 'Use `%s` single-line comments, not `%s`.',
+ '//',
+ '#'),
'#',
preg_match('/^#\S/', $value) ? '// ' : '//');
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistDeclarationParenthesesXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistDeclarationParenthesesXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistDeclarationParenthesesXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistDeclarationParenthesesXHPASTLinterRule.php
@@ -78,7 +78,9 @@
if (!$before) {
$this->raiseLintAtOffset(
$use->getOffset(),
- pht('Convention: space before `%s` token.', 'use'),
+ pht(
+ 'Convention: space before `%s` token.',
+ 'use'),
'',
' ');
}
@@ -86,7 +88,9 @@
if (!$after) {
$this->raiseLintAtOffset(
$use->getOffset() + strlen($use->getValue()),
- pht('Convention: space after `%s` token.', 'use'),
+ pht(
+ 'Convention: space after `%s` token.',
+ 'use'),
'',
' ');
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistDynamicDefineXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistDynamicDefineXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistDynamicDefineXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistDynamicDefineXHPASTLinterRule.php
@@ -6,7 +6,7 @@
const ID = 12;
public function getLintName() {
- return pht('Dynamic %s', 'define()');
+ return pht('Dynamic `%s`', 'define');
}
public function process(XHPASTNode $root) {
@@ -20,8 +20,8 @@
$this->raiseLintAtNode(
$defined,
pht(
- 'First argument to %s must be a string literal.',
- 'define()'));
+ 'First argument to `%s` must be a string literal.',
+ 'define'));
}
}
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistElseIfUsageXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistElseIfUsageXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistElseIfUsageXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistElseIfUsageXHPASTLinterRule.php
@@ -6,7 +6,7 @@
const ID = 42;
public function getLintName() {
- return pht('ElseIf Usage');
+ return pht('`elseif` Usage');
}
public function getLintSeverity() {
@@ -19,7 +19,10 @@
foreach ($tokens as $token) {
$this->raiseLintAtToken(
$token,
- pht('Usage of `%s` is preferred over `%s`.', 'else if', 'elseif'),
+ pht(
+ 'Usage of `%s` is preferred over `%s`.',
+ 'else if',
+ 'elseif'),
'else if');
}
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistExitExpressionXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistExitExpressionXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistExitExpressionXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistExitExpressionXHPASTLinterRule.php
@@ -21,7 +21,7 @@
const ID = 17;
public function getLintName() {
- return pht('Exit Used as Expression');
+ return pht('`%s` Used as Expression', 'exit');
}
public function process(XHPASTNode $root) {
@@ -34,7 +34,9 @@
if ($unary->getParentNode()->getTypeName() !== 'n_STATEMENT') {
$this->raiseLintAtNode(
$unary,
- pht('Use `%s` as a statement, not an expression.', 'exit'));
+ pht(
+ 'Use `%s` as a statement, not an expression.',
+ 'exit'));
}
}
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistExtractUseXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistExtractUseXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistExtractUseXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistExtractUseXHPASTLinterRule.php
@@ -6,7 +6,7 @@
const ID = 4;
public function getLintName() {
- return pht('Use of %s', 'extract()');
+ return pht('Use of `%s`', 'extract');
}
public function process(XHPASTNode $root) {
@@ -16,8 +16,8 @@
$this->raiseLintAtNode(
$call,
pht(
- 'Avoid %s. It is confusing and hinders static analysis.',
- 'extract()'));
+ 'Avoid `%s`. It is confusing and hinders static analysis.',
+ 'extract'));
}
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistFormattedStringXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistFormattedStringXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistFormattedStringXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistFormattedStringXHPASTLinterRule.php
@@ -16,7 +16,7 @@
'xhpast.printf-functions' => array(
'type' => 'optional map<string, int>',
'help' => pht(
- '%s-style functions which take a format string and list of values '.
+ '`%s`-style functions which take a format string and list of values '.
'as arguments. The value for the mapping is the start index of the '.
'function parameters (the index of the format string parameter).',
'printf()'),
diff --git a/src/lint/linter/xhpast/rules/ArcanistImplicitConstructorXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistImplicitConstructorXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistImplicitConstructorXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistImplicitConstructorXHPASTLinterRule.php
@@ -24,9 +24,10 @@
$this->raiseLintAtNode(
$method_name_token,
pht(
- 'Name constructors %s explicitly. This method is a constructor '.
- ' because it has the same name as the class it is defined in.',
- '__construct()'));
+ 'Name constructors `%s` explicitly. This method is a '.
+ 'constructor because it has the same name as the class '.
+ 'it is defined in.',
+ '__construct'));
}
}
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistImplicitFallthroughXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistImplicitFallthroughXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistImplicitFallthroughXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistImplicitFallthroughXHPASTLinterRule.php
@@ -20,10 +20,10 @@
'xhpast.switchhook' => array(
'type' => 'optional string',
'help' => pht(
- 'Name of a concrete subclass of %s which tunes the '.
- 'analysis of %s statements for this linter.',
+ 'Name of a concrete subclass of `%s` which tunes the '.
+ 'analysis of `%s` statements for this linter.',
'ArcanistXHPASTLintSwitchHook',
- 'switch()'),
+ 'switch'),
),
);
}
@@ -190,9 +190,9 @@
$this->raiseLintAtToken(
head($tokens),
pht(
- "This '%s' or '%s' has a nonempty block which does not end ".
- "with '%s', '%s', '%s', '%s' or '%s'. Did you forget to add ".
- "one of those? If you intend to fall through, add a '%s' ".
+ 'This `%s` or `%s` has a nonempty block which does not end '.
+ 'with `%s`, `%s`, `%s`, `%s` or `%s`. Did you forget to add '.
+ 'one of those? If you intend to fall through, add a `%s` '.
"comment to silence this warning.",
'case',
'default',
diff --git a/src/lint/linter/xhpast/rules/ArcanistInstanceOfOperatorXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistInstanceOfOperatorXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistInstanceOfOperatorXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistInstanceOfOperatorXHPASTLinterRule.php
@@ -6,7 +6,7 @@
const ID = 69;
public function getLintName() {
- return pht('%s Operator', 'instanceof');
+ return pht('`%s` Operator', 'instanceof');
}
public function process(XHPASTNode $root) {
@@ -26,7 +26,7 @@
$this->raiseLintAtNode(
$object,
pht(
- '%s expects an object instance, constant given.',
+ '`%s` expects an object instance, constant given.',
'instanceof'));
}
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistInvalidDefaultParameterXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistInvalidDefaultParameterXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistInvalidDefaultParameterXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistInvalidDefaultParameterXHPASTLinterRule.php
@@ -39,8 +39,8 @@
$this->raiseLintAtNode(
$default,
pht(
- 'Default value for parameters with %s type hint '.
- 'can only be an %s or %s.',
+ 'Default value for parameters with `%s` type hint '.
+ 'can only be an `%s` or `%s`.',
'array',
'array',
'null'));
@@ -54,7 +54,8 @@
$this->raiseLintAtNode(
$default,
pht(
- 'Default value for parameters with %s type hint can only be %s.',
+ 'Default value for parameters with `%s` type hint '.
+ 'can only be `%s`.',
'callable',
'null'));
break;
@@ -69,7 +70,7 @@
$default,
pht(
'Default value for parameters with a class type hint '.
- 'can only be %s.',
+ 'can only be `%s`.',
'null'));
break;
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistInvalidModifiersXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistInvalidModifiersXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistInvalidModifiersXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistInvalidModifiersXHPASTLinterRule.php
@@ -30,7 +30,7 @@
$this->raiseLintAtNode(
$modifier,
pht(
- 'Properties cannot be declared %s.',
+ 'Properties cannot be declared `%s`.',
'abstract'));
}
@@ -38,7 +38,7 @@
$this->raiseLintAtNode(
$modifier,
pht(
- 'Multiple %s modifiers are not allowed.',
+ 'Multiple `%s` modifiers are not allowed.',
'abstract'));
}
@@ -46,7 +46,7 @@
$this->raiseLintAtNode(
$modifier,
pht(
- 'Cannot use the %s modifier on an %s class member',
+ 'Cannot use the `%s` modifier on an `%s` class member',
'final',
'abstract'));
}
@@ -59,7 +59,7 @@
$this->raiseLintAtNode(
$modifier,
pht(
- 'Cannot use the %s modifier on an %s class member',
+ 'Cannot use the `%s` modifier on an `%s` class member',
'final',
'abstract'));
}
@@ -68,7 +68,7 @@
$this->raiseLintAtNode(
$modifier,
pht(
- 'Multiple %s modifiers are not allowed.',
+ 'Multiple `%s` modifiers are not allowed.',
'final'));
}
@@ -91,7 +91,7 @@
$this->raiseLintAtNode(
$modifier,
pht(
- 'Multiple %s modifiers are not allowed.',
+ 'Multiple `%s` modifiers are not allowed.',
'static'));
}
break;
diff --git a/src/lint/linter/xhpast/rules/ArcanistKeywordCasingXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistKeywordCasingXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistKeywordCasingXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistKeywordCasingXHPASTLinterRule.php
@@ -89,7 +89,7 @@
$this->raiseLintAtToken(
$keyword,
pht(
- "Convention: spell keyword '%s' as '%s'.",
+ 'Convention: spell keyword `%s` as `%s`.',
$value,
strtolower($value)),
strtolower($value));
@@ -115,7 +115,7 @@
$this->raiseLintAtNode(
$symbol,
pht(
- "Convention: spell keyword '%s' as '%s'.",
+ 'Convention: spell keyword `%s` as `%s`.',
$symbol_name,
strtolower($symbol_name)),
strtolower($symbol_name));
diff --git a/src/lint/linter/xhpast/rules/ArcanistLambdaFuncFunctionXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistLambdaFuncFunctionXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistLambdaFuncFunctionXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistLambdaFuncFunctionXHPASTLinterRule.php
@@ -6,7 +6,7 @@
const ID = 68;
public function getLintName() {
- return pht('%s Function', '__lambda_func');
+ return pht('`%s` Function', '__lambda_func');
}
public function process(XHPASTNode $root) {
@@ -28,10 +28,10 @@
$this->raiseLintAtNode(
$function_declaration,
pht(
- 'Declaring a function named %s causes any call to %s to fail. '.
- 'This is because %s eval-declares the function %s, then '.
+ 'Declaring a function named `%s` causes any call to %s to fail. '.
+ 'This is because `%s` eval-declares the function `%s`, then '.
'modifies the symbol table so that the function is instead '.
- 'named %s, and returns that name.',
+ 'named `%s`, and returns that name.',
'__lambda_func',
'create_function',
'create_function',
diff --git a/src/lint/linter/xhpast/rules/ArcanistNamingConventionsXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistNamingConventionsXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistNamingConventionsXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistNamingConventionsXHPASTLinterRule.php
@@ -20,7 +20,7 @@
'xhpast.naminghook' => array(
'type' => 'optional string',
'help' => pht(
- 'Name of a concrete subclass of %s which enforces more '.
+ 'Name of a concrete subclass of `%s` which enforces more '.
'granular naming convention rules for symbols.',
'ArcanistXHPASTLintNamingHook'),
),
@@ -56,8 +56,8 @@
ArcanistXHPASTLintNamingHook::isUpperCamelCase($name_string)
? null
: pht(
- 'Follow naming conventions: classes should be named using '.
- 'UpperCamelCase.'),
+ 'Follow naming conventions: classes should be named using `%s`.',
+ 'UpperCamelCase'),
);
}
@@ -72,8 +72,8 @@
ArcanistXHPASTLintNamingHook::isUpperCamelCase($name_string)
? null
: pht(
- 'Follow naming conventions: interfaces should be named using '.
- 'UpperCamelCase.'),
+ 'Follow naming conventions: interfaces should be named using `%s`.',
+ 'UpperCamelCase'),
);
}
@@ -94,8 +94,8 @@
ArcanistXHPASTLintNamingHook::stripPHPFunction($name_string))
? null
: pht(
- 'Follow naming conventions: functions should be named using '.
- 'lowercase_with_underscores.'),
+ 'Follow naming conventions: functions should be named using `%s`.',
+ 'lowercase_with_underscores'),
);
}
@@ -112,8 +112,8 @@
ArcanistXHPASTLintNamingHook::stripPHPFunction($name_string))
? null
: pht(
- 'Follow naming conventions: methods should be named using '.
- 'lowerCamelCase.'),
+ 'Follow naming conventions: methods should be named using `%s`.',
+ 'lowerCamelCase'),
);
}
@@ -137,8 +137,9 @@
ArcanistXHPASTLintNamingHook::stripPHPVariable($name_string))
? null
: pht(
- 'Follow naming conventions: parameters should be named using '.
- 'lowercase_with_underscores.'),
+ 'Follow naming conventions: parameters '.
+ 'should be named using `%s`',
+ 'lowercase_with_underscores'),
);
}
}
@@ -157,8 +158,9 @@
ArcanistXHPASTLintNamingHook::isUppercaseWithUnderscores($name_string)
? null
: pht(
- 'Follow naming conventions: class constants should be named '.
- 'using UPPERCASE_WITH_UNDERSCORES.'),
+ 'Follow naming conventions: class constants '.
+ 'should be named using `%s`',
+ 'UPPERCASE_WITH_UNDERSCORES'),
);
}
}
@@ -184,8 +186,9 @@
ArcanistXHPASTLintNamingHook::stripPHPVariable($name_string))
? null
: pht(
- 'Follow naming conventions: class properties should be named '.
- 'using lowerCamelCase.'),
+ 'Follow naming conventions: class properties '.
+ 'should be named using `%s`.',
+ 'lowerCamelCase'),
);
}
}
@@ -269,8 +272,9 @@
ArcanistXHPASTLintNamingHook::stripPHPVariable($var_string))
? null
: pht(
- 'Follow naming conventions: variables should be named using '.
- 'lowercase_with_underscores.'),
+ 'Follow naming conventions: variables '.
+ 'should be named using `%s`.',
+ 'lowercase_with_underscores'),
);
}
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistNewlineAfterOpenTagXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistNewlineAfterOpenTagXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistNewlineAfterOpenTagXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistNewlineAfterOpenTagXHPASTLinterRule.php
@@ -38,7 +38,9 @@
$next = $token->getNextToken();
$this->raiseLintAtToken(
$next,
- pht('`%s` should be separated from code by an empty line.', '<?php'),
+ pht(
+ '`%s` should be separated from code by an empty line.',
+ '<?php'),
"\n".$next->getValue());
}
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistNoParentScopeXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistNoParentScopeXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistNoParentScopeXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistNoParentScopeXHPASTLinterRule.php
@@ -34,7 +34,7 @@
$this->raiseLintAtNode(
$static_access,
pht(
- 'Cannot access %s when current class scope has no parent.',
+ 'Cannot access `%s` when current class scope has no parent.',
'parent::'));
}
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistPHPCloseTagXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistPHPCloseTagXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistPHPCloseTagXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistPHPCloseTagXHPASTLinterRule.php
@@ -6,7 +6,7 @@
const ID = 8;
public function getLintName() {
- return pht('Use of Close Tag "%s"', '?>');
+ return pht('Use of Close Tag `%s`', '?>');
}
public function process(XHPASTNode $root) {
@@ -19,7 +19,9 @@
foreach ($root->selectTokensOfType('T_CLOSE_TAG') as $token) {
$this->raiseLintAtToken(
$token,
- pht('Do not use the PHP closing tag, "%s".', '?>'));
+ pht(
+ 'Do not use the PHP closing tag, `%s`.',
+ '?>'));
}
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistPHPEchoTagXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistPHPEchoTagXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistPHPEchoTagXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistPHPEchoTagXHPASTLinterRule.php
@@ -6,7 +6,7 @@
const ID = 7;
public function getLintName() {
- return pht('Use of Echo Tag "%s"', '<?=');
+ return pht('Use of Echo Tag `%s`', '<?=');
}
public function process(XHPASTNode $root) {
@@ -16,7 +16,9 @@
if ($token->getTypeName() === 'T_OPEN_TAG_WITH_ECHO') {
$this->raiseLintAtToken(
$token,
- pht('Avoid the PHP echo short form, "%s".', '<?='));
+ pht(
+ 'Avoid the PHP echo short form, `%s`.',
+ '<?='));
}
}
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistPHPOpenTagXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistPHPOpenTagXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistPHPOpenTagXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistPHPOpenTagXHPASTLinterRule.php
@@ -22,8 +22,8 @@
$this->raiseLintAtToken(
$token,
pht(
- 'PHP files should start with "%s", which may be preceded by '.
- 'a "%s" line for scripts.',
+ 'PHP files should start with `%s`, which may be preceded by '.
+ 'a `%s` line for scripts.',
'<?php',
'#!'));
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistPHPShortTagXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistPHPShortTagXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistPHPShortTagXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistPHPShortTagXHPASTLinterRule.php
@@ -6,7 +6,7 @@
const ID = 6;
public function getLintName() {
- return pht('Use of Short Tag "%s"', '<?');
+ return pht('Use of Short Tag `%s`', '<?');
}
public function process(XHPASTNode $root) {
@@ -18,7 +18,7 @@
$this->raiseLintAtToken(
$token,
pht(
- 'Use the full form of the PHP open tag, "%s".',
+ 'Use the full form of the PHP open tag, `%s`.',
'<?php'),
"<?php\n");
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistParseStrUseXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistParseStrUseXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistParseStrUseXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistParseStrUseXHPASTLinterRule.php
@@ -6,7 +6,7 @@
const ID = 80;
public function getLintName() {
- return pht('Questionable Use of %s', 'parse_str()');
+ return pht('Questionable Use of `%s`', 'parse_str');
}
public function process(XHPASTNode $root) {
@@ -19,9 +19,9 @@
$this->raiseLintAtNode(
$call,
pht(
- 'Avoid %s unless the second parameter is specified. '.
+ 'Avoid `%s` unless the second parameter is specified. '.
'It is confusing and hinders static analysis.',
- 'parse_str()'));
+ 'parse_str'));
}
}
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistPlusOperatorOnStringsXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistPlusOperatorOnStringsXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistPlusOperatorOnStringsXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistPlusOperatorOnStringsXHPASTLinterRule.php
@@ -26,9 +26,10 @@
$this->raiseLintAtNode(
$binop,
pht(
- "In PHP, '%s' is the string concatenation operator, not '%s'. ".
- "This expression uses '+' with a string literal as an operand.",
+ 'In PHP, `%s` is the string concatenation operator, not `%s`. '.
+ 'This expression uses `%s` with a string literal as an operand.',
'.',
+ '+',
'+'));
}
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistPregQuoteMisuseXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistPregQuoteMisuseXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistPregQuoteMisuseXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistPregQuoteMisuseXHPASTLinterRule.php
@@ -12,7 +12,7 @@
const ID = 14;
public function getLintName() {
- return pht('Misuse of %s', 'preg_quote()');
+ return pht('Misuse of `%s`', 'preg_quote');
}
public function getLintSeverity() {
@@ -33,8 +33,8 @@
'arguments to %s, so that %s knows which delimiter to escape.',
'//',
'()',
- 'preg_quote()',
- 'preg_quote()'));
+ 'preg_quote',
+ 'preg_quote'));
}
}
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistRaggedClassTreeEdgeXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistRaggedClassTreeEdgeXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistRaggedClassTreeEdgeXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistRaggedClassTreeEdgeXHPASTLinterRule.php
@@ -6,7 +6,7 @@
const ID = 87;
public function getLintName() {
- return pht('Class Not %s Or %s', 'abstract', 'final');
+ return pht('Class Not `%s` Or `%s`', 'abstract', 'final');
}
public function getLintSeverity() {
@@ -42,8 +42,8 @@
$this->raiseLintAtNode(
$class->getChildOfType(1, 'n_CLASS_NAME'),
pht(
- "This class is neither '%s' nor '%s', and does not have ".
- "a docblock marking it '%s'.",
+ 'This class is neither `%s` nor `%s`, and does not have '.
+ 'a docblock marking it `%s`.',
'final',
'abstract',
'@concrete-extensible'));
diff --git a/src/lint/linter/xhpast/rules/ArcanistReusedIteratorReferenceXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistReusedIteratorReferenceXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistReusedIteratorReferenceXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistReusedIteratorReferenceXHPASTLinterRule.php
@@ -173,7 +173,7 @@
$var,
pht(
'This variable was used already as a by-reference iterator '.
- 'variable. Such variables survive outside the %s loop, '.
+ 'variable. Such variables survive outside the `%s` loop, '.
'do not reuse.',
'foreach'));
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistSlownessXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistSlownessXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistSlownessXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistSlownessXHPASTLinterRule.php
@@ -51,14 +51,14 @@
$this->raiseLintAtNode(
$strstr,
pht(
- 'Use %s for checking if the string contains something.',
- 'strpos()'));
+ 'Use `%s` for checking if the string contains something.',
+ 'strpos'));
} else if ($name === 'stristr') {
$this->raiseLintAtNode(
$strstr,
pht(
- 'Use %s for checking if the string contains something.',
- 'stripos()'));
+ 'Use `%s` for checking if the string contains something.',
+ 'stripos'));
}
}
}
@@ -96,14 +96,14 @@
$this->raiseLintAtNode(
$strpos,
pht(
- 'Use %s for checking if the string starts with something.',
- 'strncmp()'));
+ 'Use `%s` for checking if the string starts with something.',
+ 'strncmp'));
} else if ($name === 'stripos') {
$this->raiseLintAtNode(
$strpos,
pht(
- 'Use %s for checking if the string starts with something.',
- 'strncasecmp()'));
+ 'Use `%s` for checking if the string starts with something.',
+ 'strncasecmp'));
}
}
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistStaticThisXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistStaticThisXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistStaticThisXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistStaticThisXHPASTLinterRule.php
@@ -6,7 +6,7 @@
const ID = 13;
public function getLintName() {
- return pht('Use of %s in Static Context', '$this');
+ return pht('Use of `%s` in Static Context', '$this');
}
public function process(XHPASTNode $root) {
diff --git a/src/lint/linter/xhpast/rules/ArcanistToStringExceptionXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistToStringExceptionXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistToStringExceptionXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistToStringExceptionXHPASTLinterRule.php
@@ -6,7 +6,7 @@
const ID = 67;
public function getLintName() {
- return pht('Throwing Exception in %s Method', '__toString');
+ return pht('Throwing Exception in `%s` Method', '__toString');
}
public function process(XHPASTNode $root) {
@@ -33,7 +33,7 @@
$this->raiseLintAtNode(
$throw,
pht(
- 'It is not possible to throw an %s from within the %s method.',
+ 'It is not possible to throw an `%s` from within the `%s` method.',
'Exception',
'__toString'));
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistUnnecessaryFinalModifierXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistUnnecessaryFinalModifierXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistUnnecessaryFinalModifierXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistUnnecessaryFinalModifierXHPASTLinterRule.php
@@ -40,7 +40,7 @@
$this->raiseLintAtNode(
$attribute,
pht(
- 'Unnecessary %s modifier in %s class.',
+ 'Unnecessary `%s` modifier in `%s` class.',
'final',
'final'));
}
diff --git a/src/lint/linter/xhpast/rules/ArcanistUnsafeDynamicStringXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistUnsafeDynamicStringXHPASTLinterRule.php
--- a/src/lint/linter/xhpast/rules/ArcanistUnsafeDynamicStringXHPASTLinterRule.php
+++ b/src/lint/linter/xhpast/rules/ArcanistUnsafeDynamicStringXHPASTLinterRule.php
@@ -92,10 +92,10 @@
$this->raiseLintAtNode(
$call,
pht(
- "Parameter %d of %s should be a scalar string, ".
+ "Parameter %d of `%s` should be a scalar string, ".
"otherwise it's not safe.",
$param + 1,
- $name.'()'));
+ $name));
}
}
}

File Metadata

Mime Type
text/plain
Expires
Sep 12 2025, 11:48 PM (6 w, 20 h ago)
Storage Engine
amazon-s3
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
phabricator/secure/kq/uf/tpgkizam6nrwuqew
Default Alt Text
D14489.diff (33 KB)

Event Timeline