mirror of
https://we.phorge.it/source/arcanist.git
synced 2025-01-04 03:41:01 +01:00
(stable) Promote 2015 Week 48
This commit is contained in:
commit
76ea4e688d
75 changed files with 762 additions and 117 deletions
|
@ -9,6 +9,10 @@
|
||||||
phutil_register_library_map(array(
|
phutil_register_library_map(array(
|
||||||
'__library_version__' => 2,
|
'__library_version__' => 2,
|
||||||
'class' => array(
|
'class' => array(
|
||||||
|
'ArcanistAbstractMethodBodyXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistAbstractMethodBodyXHPASTLinterRule.php',
|
||||||
|
'ArcanistAbstractMethodBodyXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistAbstractMethodBodyXHPASTLinterRuleTestCase.php',
|
||||||
|
'ArcanistAbstractPrivateMethodXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistAbstractPrivateMethodXHPASTLinterRule.php',
|
||||||
|
'ArcanistAbstractPrivateMethodXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistAbstractPrivateMethodXHPASTLinterRuleTestCase.php',
|
||||||
'ArcanistAliasFunctionXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistAliasFunctionXHPASTLinterRule.php',
|
'ArcanistAliasFunctionXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistAliasFunctionXHPASTLinterRule.php',
|
||||||
'ArcanistAliasFunctionXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistAliasFunctionXHPASTLinterRuleTestCase.php',
|
'ArcanistAliasFunctionXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistAliasFunctionXHPASTLinterRuleTestCase.php',
|
||||||
'ArcanistAliasWorkflow' => 'workflow/ArcanistAliasWorkflow.php',
|
'ArcanistAliasWorkflow' => 'workflow/ArcanistAliasWorkflow.php',
|
||||||
|
@ -55,6 +59,8 @@ phutil_register_library_map(array(
|
||||||
'ArcanistClassExtendsObjectXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistClassExtendsObjectXHPASTLinterRule.php',
|
'ArcanistClassExtendsObjectXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistClassExtendsObjectXHPASTLinterRule.php',
|
||||||
'ArcanistClassExtendsObjectXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistClassExtendsObjectXHPASTLinterRuleTestCase.php',
|
'ArcanistClassExtendsObjectXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistClassExtendsObjectXHPASTLinterRuleTestCase.php',
|
||||||
'ArcanistClassFilenameMismatchXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistClassFilenameMismatchXHPASTLinterRule.php',
|
'ArcanistClassFilenameMismatchXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistClassFilenameMismatchXHPASTLinterRule.php',
|
||||||
|
'ArcanistClassMustBeDeclaredAbstractXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistClassMustBeDeclaredAbstractXHPASTLinterRule.php',
|
||||||
|
'ArcanistClassMustBeDeclaredAbstractXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistClassMustBeDeclaredAbstractXHPASTLinterRuleTestCase.php',
|
||||||
'ArcanistClassNameLiteralXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistClassNameLiteralXHPASTLinterRule.php',
|
'ArcanistClassNameLiteralXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistClassNameLiteralXHPASTLinterRule.php',
|
||||||
'ArcanistClassNameLiteralXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistClassNameLiteralXHPASTLinterRuleTestCase.php',
|
'ArcanistClassNameLiteralXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistClassNameLiteralXHPASTLinterRuleTestCase.php',
|
||||||
'ArcanistCloseRevisionWorkflow' => 'workflow/ArcanistCloseRevisionWorkflow.php',
|
'ArcanistCloseRevisionWorkflow' => 'workflow/ArcanistCloseRevisionWorkflow.php',
|
||||||
|
@ -172,6 +178,10 @@ phutil_register_library_map(array(
|
||||||
'ArcanistInstallCertificateWorkflow' => 'workflow/ArcanistInstallCertificateWorkflow.php',
|
'ArcanistInstallCertificateWorkflow' => 'workflow/ArcanistInstallCertificateWorkflow.php',
|
||||||
'ArcanistInstanceOfOperatorXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistInstanceOfOperatorXHPASTLinterRule.php',
|
'ArcanistInstanceOfOperatorXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistInstanceOfOperatorXHPASTLinterRule.php',
|
||||||
'ArcanistInstanceofOperatorXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistInstanceofOperatorXHPASTLinterRuleTestCase.php',
|
'ArcanistInstanceofOperatorXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistInstanceofOperatorXHPASTLinterRuleTestCase.php',
|
||||||
|
'ArcanistInterfaceAbstractMethodXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistInterfaceAbstractMethodXHPASTLinterRule.php',
|
||||||
|
'ArcanistInterfaceAbstractMethodXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistInterfaceAbstractMethodXHPASTLinterRuleTestCase.php',
|
||||||
|
'ArcanistInterfaceMethodBodyXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistInterfaceMethodBodyXHPASTLinterRule.php',
|
||||||
|
'ArcanistInterfaceMethodBodyXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistInterfaceMethodBodyXHPASTLinterRuleTestCase.php',
|
||||||
'ArcanistInvalidDefaultParameterXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistInvalidDefaultParameterXHPASTLinterRule.php',
|
'ArcanistInvalidDefaultParameterXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistInvalidDefaultParameterXHPASTLinterRule.php',
|
||||||
'ArcanistInvalidDefaultParameterXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistInvalidDefaultParameterXHPASTLinterRuleTestCase.php',
|
'ArcanistInvalidDefaultParameterXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistInvalidDefaultParameterXHPASTLinterRuleTestCase.php',
|
||||||
'ArcanistInvalidModifiersXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistInvalidModifiersXHPASTLinterRule.php',
|
'ArcanistInvalidModifiersXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistInvalidModifiersXHPASTLinterRule.php',
|
||||||
|
@ -224,6 +234,8 @@ phutil_register_library_map(array(
|
||||||
'ArcanistMissingLinterException' => 'lint/linter/exception/ArcanistMissingLinterException.php',
|
'ArcanistMissingLinterException' => 'lint/linter/exception/ArcanistMissingLinterException.php',
|
||||||
'ArcanistModifierOrderingXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistModifierOrderingXHPASTLinterRule.php',
|
'ArcanistModifierOrderingXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistModifierOrderingXHPASTLinterRule.php',
|
||||||
'ArcanistModifierOrderingXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistModifierOrderingXHPASTLinterRuleTestCase.php',
|
'ArcanistModifierOrderingXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistModifierOrderingXHPASTLinterRuleTestCase.php',
|
||||||
|
'ArcanistNamespaceFirstStatementXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistNamespaceFirstStatementXHPASTLinterRule.php',
|
||||||
|
'ArcanistNamespaceFirstStatementXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistNamespaceFirstStatementXHPASTLinterRuleTestCase.php',
|
||||||
'ArcanistNamingConventionsXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistNamingConventionsXHPASTLinterRule.php',
|
'ArcanistNamingConventionsXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistNamingConventionsXHPASTLinterRule.php',
|
||||||
'ArcanistNamingConventionsXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistNamingConventionsXHPASTLinterRuleTestCase.php',
|
'ArcanistNamingConventionsXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistNamingConventionsXHPASTLinterRuleTestCase.php',
|
||||||
'ArcanistNestedNamespacesXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistNestedNamespacesXHPASTLinterRule.php',
|
'ArcanistNestedNamespacesXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistNestedNamespacesXHPASTLinterRule.php',
|
||||||
|
@ -347,11 +359,15 @@ phutil_register_library_map(array(
|
||||||
'ArcanistUnnecessaryFinalModifierXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistUnnecessaryFinalModifierXHPASTLinterRule.php',
|
'ArcanistUnnecessaryFinalModifierXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistUnnecessaryFinalModifierXHPASTLinterRule.php',
|
||||||
'ArcanistUnnecessaryFinalModifierXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistUnnecessaryFinalModifierXHPASTLinterRuleTestCase.php',
|
'ArcanistUnnecessaryFinalModifierXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistUnnecessaryFinalModifierXHPASTLinterRuleTestCase.php',
|
||||||
'ArcanistUnnecessarySemicolonXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistUnnecessarySemicolonXHPASTLinterRule.php',
|
'ArcanistUnnecessarySemicolonXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistUnnecessarySemicolonXHPASTLinterRule.php',
|
||||||
|
'ArcanistUnnecessarySymbolAliasXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistUnnecessarySymbolAliasXHPASTLinterRule.php',
|
||||||
|
'ArcanistUnnecessarySymbolAliasXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistUnnecessarySymbolAliasXHPASTLinterRuleTestCase.php',
|
||||||
'ArcanistUnsafeDynamicStringXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistUnsafeDynamicStringXHPASTLinterRule.php',
|
'ArcanistUnsafeDynamicStringXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistUnsafeDynamicStringXHPASTLinterRule.php',
|
||||||
'ArcanistUnsafeDynamicStringXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistUnsafeDynamicStringXHPASTLinterRuleTestCase.php',
|
'ArcanistUnsafeDynamicStringXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistUnsafeDynamicStringXHPASTLinterRuleTestCase.php',
|
||||||
'ArcanistUpgradeWorkflow' => 'workflow/ArcanistUpgradeWorkflow.php',
|
'ArcanistUpgradeWorkflow' => 'workflow/ArcanistUpgradeWorkflow.php',
|
||||||
'ArcanistUploadWorkflow' => 'workflow/ArcanistUploadWorkflow.php',
|
'ArcanistUploadWorkflow' => 'workflow/ArcanistUploadWorkflow.php',
|
||||||
'ArcanistUsageException' => 'exception/ArcanistUsageException.php',
|
'ArcanistUsageException' => 'exception/ArcanistUsageException.php',
|
||||||
|
'ArcanistUseStatementNamespacePrefixXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistUseStatementNamespacePrefixXHPASTLinterRule.php',
|
||||||
|
'ArcanistUseStatementNamespacePrefixXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistUseStatementNamespacePrefixXHPASTLinterRuleTestCase.php',
|
||||||
'ArcanistUselessOverridingMethodXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistUselessOverridingMethodXHPASTLinterRule.php',
|
'ArcanistUselessOverridingMethodXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistUselessOverridingMethodXHPASTLinterRule.php',
|
||||||
'ArcanistUselessOverridingMethodXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistUselessOverridingMethodXHPASTLinterRuleTestCase.php',
|
'ArcanistUselessOverridingMethodXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistUselessOverridingMethodXHPASTLinterRuleTestCase.php',
|
||||||
'ArcanistUserAbortException' => 'exception/usage/ArcanistUserAbortException.php',
|
'ArcanistUserAbortException' => 'exception/usage/ArcanistUserAbortException.php',
|
||||||
|
@ -387,6 +403,10 @@ phutil_register_library_map(array(
|
||||||
),
|
),
|
||||||
'function' => array(),
|
'function' => array(),
|
||||||
'xmap' => array(
|
'xmap' => array(
|
||||||
|
'ArcanistAbstractMethodBodyXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||||
|
'ArcanistAbstractMethodBodyXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
||||||
|
'ArcanistAbstractPrivateMethodXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||||
|
'ArcanistAbstractPrivateMethodXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
||||||
'ArcanistAliasFunctionXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
'ArcanistAliasFunctionXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||||
'ArcanistAliasFunctionXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
'ArcanistAliasFunctionXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
||||||
'ArcanistAliasWorkflow' => 'ArcanistWorkflow',
|
'ArcanistAliasWorkflow' => 'ArcanistWorkflow',
|
||||||
|
@ -433,6 +453,8 @@ phutil_register_library_map(array(
|
||||||
'ArcanistClassExtendsObjectXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
'ArcanistClassExtendsObjectXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||||
'ArcanistClassExtendsObjectXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
'ArcanistClassExtendsObjectXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
||||||
'ArcanistClassFilenameMismatchXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
'ArcanistClassFilenameMismatchXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||||
|
'ArcanistClassMustBeDeclaredAbstractXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||||
|
'ArcanistClassMustBeDeclaredAbstractXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
||||||
'ArcanistClassNameLiteralXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
'ArcanistClassNameLiteralXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||||
'ArcanistClassNameLiteralXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
'ArcanistClassNameLiteralXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
||||||
'ArcanistCloseRevisionWorkflow' => 'ArcanistWorkflow',
|
'ArcanistCloseRevisionWorkflow' => 'ArcanistWorkflow',
|
||||||
|
@ -550,6 +572,10 @@ phutil_register_library_map(array(
|
||||||
'ArcanistInstallCertificateWorkflow' => 'ArcanistWorkflow',
|
'ArcanistInstallCertificateWorkflow' => 'ArcanistWorkflow',
|
||||||
'ArcanistInstanceOfOperatorXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
'ArcanistInstanceOfOperatorXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||||
'ArcanistInstanceofOperatorXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
'ArcanistInstanceofOperatorXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
||||||
|
'ArcanistInterfaceAbstractMethodXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||||
|
'ArcanistInterfaceAbstractMethodXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
||||||
|
'ArcanistInterfaceMethodBodyXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||||
|
'ArcanistInterfaceMethodBodyXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
||||||
'ArcanistInvalidDefaultParameterXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
'ArcanistInvalidDefaultParameterXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||||
'ArcanistInvalidDefaultParameterXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
'ArcanistInvalidDefaultParameterXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
||||||
'ArcanistInvalidModifiersXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
'ArcanistInvalidModifiersXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||||
|
@ -602,6 +628,8 @@ phutil_register_library_map(array(
|
||||||
'ArcanistMissingLinterException' => 'Exception',
|
'ArcanistMissingLinterException' => 'Exception',
|
||||||
'ArcanistModifierOrderingXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
'ArcanistModifierOrderingXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||||
'ArcanistModifierOrderingXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
'ArcanistModifierOrderingXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
||||||
|
'ArcanistNamespaceFirstStatementXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||||
|
'ArcanistNamespaceFirstStatementXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
||||||
'ArcanistNamingConventionsXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
'ArcanistNamingConventionsXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||||
'ArcanistNamingConventionsXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
'ArcanistNamingConventionsXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
||||||
'ArcanistNestedNamespacesXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
'ArcanistNestedNamespacesXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||||
|
@ -725,11 +753,15 @@ phutil_register_library_map(array(
|
||||||
'ArcanistUnnecessaryFinalModifierXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
'ArcanistUnnecessaryFinalModifierXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||||
'ArcanistUnnecessaryFinalModifierXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
'ArcanistUnnecessaryFinalModifierXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
||||||
'ArcanistUnnecessarySemicolonXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
'ArcanistUnnecessarySemicolonXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||||
|
'ArcanistUnnecessarySymbolAliasXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||||
|
'ArcanistUnnecessarySymbolAliasXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
||||||
'ArcanistUnsafeDynamicStringXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
'ArcanistUnsafeDynamicStringXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||||
'ArcanistUnsafeDynamicStringXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
'ArcanistUnsafeDynamicStringXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
||||||
'ArcanistUpgradeWorkflow' => 'ArcanistWorkflow',
|
'ArcanistUpgradeWorkflow' => 'ArcanistWorkflow',
|
||||||
'ArcanistUploadWorkflow' => 'ArcanistWorkflow',
|
'ArcanistUploadWorkflow' => 'ArcanistWorkflow',
|
||||||
'ArcanistUsageException' => 'Exception',
|
'ArcanistUsageException' => 'Exception',
|
||||||
|
'ArcanistUseStatementNamespacePrefixXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||||
|
'ArcanistUseStatementNamespacePrefixXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
||||||
'ArcanistUselessOverridingMethodXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
'ArcanistUselessOverridingMethodXHPASTLinterRule' => 'ArcanistXHPASTLinterRule',
|
||||||
'ArcanistUselessOverridingMethodXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
'ArcanistUselessOverridingMethodXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase',
|
||||||
'ArcanistUserAbortException' => 'ArcanistUsageException',
|
'ArcanistUserAbortException' => 'ArcanistUsageException',
|
||||||
|
|
|
@ -225,6 +225,34 @@ abstract class ArcanistXHPASTLinterRule extends Phobject {
|
||||||
return AASTNodeList::newFromTreeAndNodes($root->getTree(), $nodes);
|
return AASTNodeList::newFromTreeAndNodes($root->getTree(), $nodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get class/method modifiers.
|
||||||
|
*
|
||||||
|
* @param XHPASTNode A node of type `n_CLASS_DECLARATION` or
|
||||||
|
* `n_METHOD_DECLARATION`.
|
||||||
|
* @return map<string, bool> Class/method modifiers.
|
||||||
|
*/
|
||||||
|
final protected function getModifiers(XHPASTNode $node) {
|
||||||
|
$modifier_list = $node->getChildByIndex(0);
|
||||||
|
|
||||||
|
switch ($modifier_list->getTypeName()) {
|
||||||
|
case 'n_CLASS_ATTRIBUTES':
|
||||||
|
case 'n_METHOD_MODIFIER_LIST':
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
$modifiers = array();
|
||||||
|
|
||||||
|
foreach ($modifier_list->selectDescendantsOfType('n_STRING') as $modifier) {
|
||||||
|
$modifiers[strtolower($modifier->getConcreteString())] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $modifiers;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get PHP superglobals.
|
* Get PHP superglobals.
|
||||||
*
|
*
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class ArcanistAbstractMethodBodyXHPASTLinterRule
|
||||||
|
extends ArcanistXHPASTLinterRule {
|
||||||
|
|
||||||
|
const ID = 108;
|
||||||
|
|
||||||
|
public function getLintName() {
|
||||||
|
return pht('`%s` Method Cannot Contain Body', 'abstract');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function process(XHPASTNode $root) {
|
||||||
|
$methods = $root->selectDescendantsOfType('n_METHOD_DECLARATION');
|
||||||
|
|
||||||
|
foreach ($methods as $method) {
|
||||||
|
$modifiers = $this->getModifiers($method);
|
||||||
|
$body = $method->getChildByIndex(5);
|
||||||
|
|
||||||
|
if (idx($modifiers, 'abstract') && $body->getTypeName() != 'n_EMPTY') {
|
||||||
|
$this->raiseLintAtNode(
|
||||||
|
$body,
|
||||||
|
pht(
|
||||||
|
'`%s` methods cannot contain a body. This construct will '.
|
||||||
|
'cause a fatal error.',
|
||||||
|
'abstract'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,37 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class ArcanistAbstractPrivateMethodXHPASTLinterRule
|
||||||
|
extends ArcanistXHPASTLinterRule {
|
||||||
|
|
||||||
|
const ID = 107;
|
||||||
|
|
||||||
|
public function getLintName() {
|
||||||
|
return pht('`%s` Method Cannot Be Declared `%s`', 'abstract', 'private');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function process(XHPASTNode $root) {
|
||||||
|
$methods = $root->selectDescendantsOfType('n_METHOD_DECLARATION');
|
||||||
|
|
||||||
|
foreach ($methods as $method) {
|
||||||
|
$method_modifiers = $method
|
||||||
|
->getChildOfType(0, 'n_METHOD_MODIFIER_LIST')
|
||||||
|
->selectDescendantsOfType('n_STRING');
|
||||||
|
$modifiers = array();
|
||||||
|
|
||||||
|
foreach ($method_modifiers as $modifier) {
|
||||||
|
$modifiers[strtolower($modifier->getConcreteString())] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (idx($modifiers, 'abstract') && idx($modifiers, 'private')) {
|
||||||
|
$this->raiseLintAtNode(
|
||||||
|
$method,
|
||||||
|
pht(
|
||||||
|
'`%s` method cannot be declared `%s`. '.
|
||||||
|
'This construct will cause a fatal error.',
|
||||||
|
'abstract',
|
||||||
|
'private'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -6,7 +6,7 @@ final class ArcanistArrayCombineXHPASTLinterRule
|
||||||
const ID = 84;
|
const ID = 84;
|
||||||
|
|
||||||
public function getLintName() {
|
public function getLintName() {
|
||||||
return pht('%s Unreliable', 'array_combine()');
|
return pht('`%s` Unreliable', 'array_combine()');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLintSeverity() {
|
public function getLintSeverity() {
|
||||||
|
@ -35,8 +35,8 @@ final class ArcanistArrayCombineXHPASTLinterRule
|
||||||
'Prior to PHP 5.4, `%s` fails when given empty arrays. '.
|
'Prior to PHP 5.4, `%s` fails when given empty arrays. '.
|
||||||
'Prefer to write `%s` as `%s`.',
|
'Prefer to write `%s` as `%s`.',
|
||||||
'array_combine()',
|
'array_combine()',
|
||||||
'array_combine(x, x)',
|
'array_combine($x, $x)',
|
||||||
'array_fuse(x)'));
|
'array_fuse($x)'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ final class ArcanistClassExtendsObjectXHPASTLinterRule
|
||||||
const ID = 88;
|
const ID = 88;
|
||||||
|
|
||||||
public function getLintName() {
|
public function getLintName() {
|
||||||
return pht('Class Not Extending %s', 'Phobject');
|
return pht('Class Not Extending `%s`', 'Phobject');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLintSeverity() {
|
public function getLintSeverity() {
|
||||||
|
@ -29,8 +29,8 @@ final class ArcanistClassExtendsObjectXHPASTLinterRule
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$class,
|
$class,
|
||||||
pht(
|
pht(
|
||||||
'Classes should extend from %s or from some other class. '.
|
'Classes should extend from `%s` or from some other class. '.
|
||||||
'All classes (except for %s itself) should have a base class.',
|
'All classes (except for `%s` itself) should have a base class.',
|
||||||
'Phobject',
|
'Phobject',
|
||||||
'Phobject'));
|
'Phobject'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ final class ArcanistClassFilenameMismatchXHPASTLinterRule
|
||||||
$decl_name,
|
$decl_name,
|
||||||
pht(
|
pht(
|
||||||
"The name of this file differs from the name of the ".
|
"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));
|
$rename));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class ArcanistClassMustBeDeclaredAbstractXHPASTLinterRule
|
||||||
|
extends ArcanistXHPASTLinterRule {
|
||||||
|
|
||||||
|
const ID = 113;
|
||||||
|
|
||||||
|
public function getLintName() {
|
||||||
|
return pht(
|
||||||
|
'`%s` Containing `%s` Methods Must Be Declared `%s`',
|
||||||
|
'class',
|
||||||
|
'abstract',
|
||||||
|
'abstract');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function process(XHPASTNode $root) {
|
||||||
|
$classes = $root->selectDescendantsOfType('n_CLASS_DECLARATION');
|
||||||
|
|
||||||
|
foreach ($classes as $class) {
|
||||||
|
$class_modifiers = $this->getModifiers($class);
|
||||||
|
|
||||||
|
$abstract_methods = array();
|
||||||
|
$methods = $class->selectDescendantsOfType('n_METHOD_DECLARATION');
|
||||||
|
|
||||||
|
foreach ($methods as $method) {
|
||||||
|
$method_modifiers = $this->getModifiers($method);
|
||||||
|
|
||||||
|
if (idx($method_modifiers, 'abstract')) {
|
||||||
|
$abstract_methods[] = $method;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!idx($class_modifiers, 'abstract') && $abstract_methods) {
|
||||||
|
$this->raiseLintAtNode(
|
||||||
|
$class,
|
||||||
|
pht(
|
||||||
|
'Class contains %s %s method(s) and must therefore '.
|
||||||
|
'be declared `%s`.',
|
||||||
|
phutil_count($abstract_methods),
|
||||||
|
'abstract',
|
||||||
|
'abstract'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -39,7 +39,7 @@ final class ArcanistClassNameLiteralXHPASTLinterRule
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$string,
|
$string,
|
||||||
pht(
|
pht(
|
||||||
"Don't hard-code class names, use %s instead.",
|
"Don't hard-code class names, use `%s` instead.",
|
||||||
'__CLASS__'),
|
'__CLASS__'),
|
||||||
$replacement);
|
$replacement);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,10 @@ final class ArcanistCommentStyleXHPASTLinterRule
|
||||||
|
|
||||||
$this->raiseLintAtOffset(
|
$this->raiseLintAtOffset(
|
||||||
$comment->getOffset(),
|
$comment->getOffset(),
|
||||||
pht('Use "%s" single-line comments, not "%s".', '//', '#'),
|
pht(
|
||||||
|
'Use `%s` single-line comments, not `%s`.',
|
||||||
|
'//',
|
||||||
|
'#'),
|
||||||
'#',
|
'#',
|
||||||
preg_match('/^#\S/', $value) ? '// ' : '//');
|
preg_match('/^#\S/', $value) ? '// ' : '//');
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,9 @@ final class ArcanistDeclarationParenthesesXHPASTLinterRule
|
||||||
if (!$before) {
|
if (!$before) {
|
||||||
$this->raiseLintAtOffset(
|
$this->raiseLintAtOffset(
|
||||||
$use->getOffset(),
|
$use->getOffset(),
|
||||||
pht('Convention: space before `%s` token.', 'use'),
|
pht(
|
||||||
|
'Convention: space before `%s` token.',
|
||||||
|
'use'),
|
||||||
'',
|
'',
|
||||||
' ');
|
' ');
|
||||||
}
|
}
|
||||||
|
@ -86,7 +88,9 @@ final class ArcanistDeclarationParenthesesXHPASTLinterRule
|
||||||
if (!$after) {
|
if (!$after) {
|
||||||
$this->raiseLintAtOffset(
|
$this->raiseLintAtOffset(
|
||||||
$use->getOffset() + strlen($use->getValue()),
|
$use->getOffset() + strlen($use->getValue()),
|
||||||
pht('Convention: space after `%s` token.', 'use'),
|
pht(
|
||||||
|
'Convention: space after `%s` token.',
|
||||||
|
'use'),
|
||||||
'',
|
'',
|
||||||
' ');
|
' ');
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ final class ArcanistDynamicDefineXHPASTLinterRule
|
||||||
const ID = 12;
|
const ID = 12;
|
||||||
|
|
||||||
public function getLintName() {
|
public function getLintName() {
|
||||||
return pht('Dynamic %s', 'define()');
|
return pht('Dynamic `%s`', 'define');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function process(XHPASTNode $root) {
|
public function process(XHPASTNode $root) {
|
||||||
|
@ -20,8 +20,8 @@ final class ArcanistDynamicDefineXHPASTLinterRule
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$defined,
|
$defined,
|
||||||
pht(
|
pht(
|
||||||
'First argument to %s must be a string literal.',
|
'First argument to `%s` must be a string literal.',
|
||||||
'define()'));
|
'define'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ final class ArcanistElseIfUsageXHPASTLinterRule
|
||||||
const ID = 42;
|
const ID = 42;
|
||||||
|
|
||||||
public function getLintName() {
|
public function getLintName() {
|
||||||
return pht('ElseIf Usage');
|
return pht('`elseif` Usage');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLintSeverity() {
|
public function getLintSeverity() {
|
||||||
|
@ -19,7 +19,10 @@ final class ArcanistElseIfUsageXHPASTLinterRule
|
||||||
foreach ($tokens as $token) {
|
foreach ($tokens as $token) {
|
||||||
$this->raiseLintAtToken(
|
$this->raiseLintAtToken(
|
||||||
$token,
|
$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');
|
'else if');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ final class ArcanistExitExpressionXHPASTLinterRule
|
||||||
const ID = 17;
|
const ID = 17;
|
||||||
|
|
||||||
public function getLintName() {
|
public function getLintName() {
|
||||||
return pht('Exit Used as Expression');
|
return pht('`%s` Used as Expression', 'exit');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function process(XHPASTNode $root) {
|
public function process(XHPASTNode $root) {
|
||||||
|
@ -34,7 +34,9 @@ final class ArcanistExitExpressionXHPASTLinterRule
|
||||||
if ($unary->getParentNode()->getTypeName() !== 'n_STATEMENT') {
|
if ($unary->getParentNode()->getTypeName() !== 'n_STATEMENT') {
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$unary,
|
$unary,
|
||||||
pht('Use `%s` as a statement, not an expression.', 'exit'));
|
pht(
|
||||||
|
'Use `%s` as a statement, not an expression.',
|
||||||
|
'exit'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ final class ArcanistExtractUseXHPASTLinterRule
|
||||||
const ID = 4;
|
const ID = 4;
|
||||||
|
|
||||||
public function getLintName() {
|
public function getLintName() {
|
||||||
return pht('Use of %s', 'extract()');
|
return pht('Use of `%s`', 'extract');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function process(XHPASTNode $root) {
|
public function process(XHPASTNode $root) {
|
||||||
|
@ -16,8 +16,8 @@ final class ArcanistExtractUseXHPASTLinterRule
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$call,
|
$call,
|
||||||
pht(
|
pht(
|
||||||
'Avoid %s. It is confusing and hinders static analysis.',
|
'Avoid `%s`. It is confusing and hinders static analysis.',
|
||||||
'extract()'));
|
'extract'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ final class ArcanistFormattedStringXHPASTLinterRule
|
||||||
'xhpast.printf-functions' => array(
|
'xhpast.printf-functions' => array(
|
||||||
'type' => 'optional map<string, int>',
|
'type' => 'optional map<string, int>',
|
||||||
'help' => pht(
|
'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 '.
|
'as arguments. The value for the mapping is the start index of the '.
|
||||||
'function parameters (the index of the format string parameter).',
|
'function parameters (the index of the format string parameter).',
|
||||||
'printf()'),
|
'printf()'),
|
||||||
|
|
|
@ -24,9 +24,10 @@ final class ArcanistImplicitConstructorXHPASTLinterRule
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$method_name_token,
|
$method_name_token,
|
||||||
pht(
|
pht(
|
||||||
'Name constructors %s explicitly. This method is a constructor '.
|
'Name constructors `%s` explicitly. This method is a '.
|
||||||
' because it has the same name as the class it is defined in.',
|
'constructor because it has the same name as the class '.
|
||||||
'__construct()'));
|
'it is defined in.',
|
||||||
|
'__construct'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,10 +20,10 @@ final class ArcanistImplicitFallthroughXHPASTLinterRule
|
||||||
'xhpast.switchhook' => array(
|
'xhpast.switchhook' => array(
|
||||||
'type' => 'optional string',
|
'type' => 'optional string',
|
||||||
'help' => pht(
|
'help' => pht(
|
||||||
'Name of a concrete subclass of %s which tunes the '.
|
'Name of a concrete subclass of `%s` which tunes the '.
|
||||||
'analysis of %s statements for this linter.',
|
'analysis of `%s` statements for this linter.',
|
||||||
'ArcanistXHPASTLintSwitchHook',
|
'ArcanistXHPASTLintSwitchHook',
|
||||||
'switch()'),
|
'switch'),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -190,9 +190,9 @@ final class ArcanistImplicitFallthroughXHPASTLinterRule
|
||||||
$this->raiseLintAtToken(
|
$this->raiseLintAtToken(
|
||||||
head($tokens),
|
head($tokens),
|
||||||
pht(
|
pht(
|
||||||
"This '%s' or '%s' has a nonempty block which does not end ".
|
'This `%s` or `%s` has a nonempty block which does not end '.
|
||||||
"with '%s', '%s', '%s', '%s' or '%s'. Did you forget to add ".
|
'with `%s`, `%s`, `%s`, `%s` or `%s`. Did you forget to add '.
|
||||||
"one of those? If you intend to fall through, add a '%s' ".
|
'one of those? If you intend to fall through, add a `%s` '.
|
||||||
"comment to silence this warning.",
|
"comment to silence this warning.",
|
||||||
'case',
|
'case',
|
||||||
'default',
|
'default',
|
||||||
|
|
|
@ -6,7 +6,7 @@ final class ArcanistInstanceOfOperatorXHPASTLinterRule
|
||||||
const ID = 69;
|
const ID = 69;
|
||||||
|
|
||||||
public function getLintName() {
|
public function getLintName() {
|
||||||
return pht('%s Operator', 'instanceof');
|
return pht('`%s` Operator', 'instanceof');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function process(XHPASTNode $root) {
|
public function process(XHPASTNode $root) {
|
||||||
|
@ -26,7 +26,7 @@ final class ArcanistInstanceOfOperatorXHPASTLinterRule
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$object,
|
$object,
|
||||||
pht(
|
pht(
|
||||||
'%s expects an object instance, constant given.',
|
'`%s` expects an object instance, constant given.',
|
||||||
'instanceof'));
|
'instanceof'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class ArcanistInterfaceAbstractMethodXHPASTLinterRule
|
||||||
|
extends ArcanistXHPASTLinterRule {
|
||||||
|
|
||||||
|
const ID = 118;
|
||||||
|
|
||||||
|
public function getLintName() {
|
||||||
|
return pht('`%s` Methods Cannot Be Marked `%s`', 'interface', 'abstract');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function process(XHPASTNode $root) {
|
||||||
|
$interfaces = $root->selectDescendantsOfType('n_INTERFACE_DECLARATION');
|
||||||
|
|
||||||
|
foreach ($interfaces as $interface) {
|
||||||
|
$methods = $interface->selectDescendantsOfType('n_METHOD_DECLARATION');
|
||||||
|
|
||||||
|
foreach ($methods as $method) {
|
||||||
|
$modifiers = $this->getModifiers($method);
|
||||||
|
|
||||||
|
if (idx($modifiers, 'abstract')) {
|
||||||
|
$this->raiseLintAtNode(
|
||||||
|
$method,
|
||||||
|
pht(
|
||||||
|
'`%s` methods cannot be marked as `%s`. This construct will '.
|
||||||
|
'cause a fatal error.',
|
||||||
|
'interface',
|
||||||
|
'abstract'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class ArcanistInterfaceMethodBodyXHPASTLinterRule
|
||||||
|
extends ArcanistXHPASTLinterRule {
|
||||||
|
|
||||||
|
const ID = 114;
|
||||||
|
|
||||||
|
public function getLintName() {
|
||||||
|
return pht('`%s` Method Cannot Contain Body', 'interface');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function process(XHPASTNode $root) {
|
||||||
|
$interfaces = $root->selectDescendantsOfType('n_INTERFACE_DECLARATION');
|
||||||
|
|
||||||
|
foreach ($interfaces as $interface) {
|
||||||
|
$methods = $interface->selectDescendantsOfType('n_METHOD_DECLARATION');
|
||||||
|
|
||||||
|
foreach ($methods as $method) {
|
||||||
|
$body = $method->getChildByIndex(5);
|
||||||
|
|
||||||
|
if ($body->getTypeName() != 'n_EMPTY') {
|
||||||
|
$this->raiseLintAtNode(
|
||||||
|
$body,
|
||||||
|
pht(
|
||||||
|
'`%s` methods cannot contain a body. This construct will '.
|
||||||
|
'cause a fatal error.',
|
||||||
|
'interface'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -39,8 +39,8 @@ final class ArcanistInvalidDefaultParameterXHPASTLinterRule
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$default,
|
$default,
|
||||||
pht(
|
pht(
|
||||||
'Default value for parameters with %s type hint '.
|
'Default value for parameters with `%s` type hint '.
|
||||||
'can only be an %s or %s.',
|
'can only be an `%s` or `%s`.',
|
||||||
'array',
|
'array',
|
||||||
'array',
|
'array',
|
||||||
'null'));
|
'null'));
|
||||||
|
@ -54,7 +54,8 @@ final class ArcanistInvalidDefaultParameterXHPASTLinterRule
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$default,
|
$default,
|
||||||
pht(
|
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',
|
'callable',
|
||||||
'null'));
|
'null'));
|
||||||
break;
|
break;
|
||||||
|
@ -69,7 +70,7 @@ final class ArcanistInvalidDefaultParameterXHPASTLinterRule
|
||||||
$default,
|
$default,
|
||||||
pht(
|
pht(
|
||||||
'Default value for parameters with a class type hint '.
|
'Default value for parameters with a class type hint '.
|
||||||
'can only be %s.',
|
'can only be `%s`.',
|
||||||
'null'));
|
'null'));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ final class ArcanistInvalidModifiersXHPASTLinterRule
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$modifier,
|
$modifier,
|
||||||
pht(
|
pht(
|
||||||
'Properties cannot be declared %s.',
|
'Properties cannot be declared `%s`.',
|
||||||
'abstract'));
|
'abstract'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ final class ArcanistInvalidModifiersXHPASTLinterRule
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$modifier,
|
$modifier,
|
||||||
pht(
|
pht(
|
||||||
'Multiple %s modifiers are not allowed.',
|
'Multiple `%s` modifiers are not allowed.',
|
||||||
'abstract'));
|
'abstract'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ final class ArcanistInvalidModifiersXHPASTLinterRule
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$modifier,
|
$modifier,
|
||||||
pht(
|
pht(
|
||||||
'Cannot use the %s modifier on an %s class member',
|
'Cannot use the `%s` modifier on an `%s` class member',
|
||||||
'final',
|
'final',
|
||||||
'abstract'));
|
'abstract'));
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ final class ArcanistInvalidModifiersXHPASTLinterRule
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$modifier,
|
$modifier,
|
||||||
pht(
|
pht(
|
||||||
'Cannot use the %s modifier on an %s class member',
|
'Cannot use the `%s` modifier on an `%s` class member',
|
||||||
'final',
|
'final',
|
||||||
'abstract'));
|
'abstract'));
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ final class ArcanistInvalidModifiersXHPASTLinterRule
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$modifier,
|
$modifier,
|
||||||
pht(
|
pht(
|
||||||
'Multiple %s modifiers are not allowed.',
|
'Multiple `%s` modifiers are not allowed.',
|
||||||
'final'));
|
'final'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ final class ArcanistInvalidModifiersXHPASTLinterRule
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$modifier,
|
$modifier,
|
||||||
pht(
|
pht(
|
||||||
'Multiple %s modifiers are not allowed.',
|
'Multiple `%s` modifiers are not allowed.',
|
||||||
'static'));
|
'static'));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -89,7 +89,7 @@ final class ArcanistKeywordCasingXHPASTLinterRule
|
||||||
$this->raiseLintAtToken(
|
$this->raiseLintAtToken(
|
||||||
$keyword,
|
$keyword,
|
||||||
pht(
|
pht(
|
||||||
"Convention: spell keyword '%s' as '%s'.",
|
'Convention: spell keyword `%s` as `%s`.',
|
||||||
$value,
|
$value,
|
||||||
strtolower($value)),
|
strtolower($value)),
|
||||||
strtolower($value));
|
strtolower($value));
|
||||||
|
@ -115,7 +115,7 @@ final class ArcanistKeywordCasingXHPASTLinterRule
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$symbol,
|
$symbol,
|
||||||
pht(
|
pht(
|
||||||
"Convention: spell keyword '%s' as '%s'.",
|
'Convention: spell keyword `%s` as `%s`.',
|
||||||
$symbol_name,
|
$symbol_name,
|
||||||
strtolower($symbol_name)),
|
strtolower($symbol_name)),
|
||||||
strtolower($symbol_name));
|
strtolower($symbol_name));
|
||||||
|
|
|
@ -6,7 +6,7 @@ final class ArcanistLambdaFuncFunctionXHPASTLinterRule
|
||||||
const ID = 68;
|
const ID = 68;
|
||||||
|
|
||||||
public function getLintName() {
|
public function getLintName() {
|
||||||
return pht('%s Function', '__lambda_func');
|
return pht('`%s` Function', '__lambda_func');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function process(XHPASTNode $root) {
|
public function process(XHPASTNode $root) {
|
||||||
|
@ -28,10 +28,10 @@ final class ArcanistLambdaFuncFunctionXHPASTLinterRule
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$function_declaration,
|
$function_declaration,
|
||||||
pht(
|
pht(
|
||||||
'Declaring a function named %s causes any call to %s to fail. '.
|
'Declaring a function named `%s` causes any call to %s to fail. '.
|
||||||
'This is because %s eval-declares the function %s, then '.
|
'This is because `%s` eval-declares the function `%s`, then '.
|
||||||
'modifies the symbol table so that the function is instead '.
|
'modifies the symbol table so that the function is instead '.
|
||||||
'named %s, and returns that name.',
|
'named `%s`, and returns that name.',
|
||||||
'__lambda_func',
|
'__lambda_func',
|
||||||
'create_function',
|
'create_function',
|
||||||
'create_function',
|
'create_function',
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class ArcanistNamespaceFirstStatementXHPASTLinterRule
|
||||||
|
extends ArcanistXHPASTLinterRule {
|
||||||
|
|
||||||
|
const ID = 98;
|
||||||
|
|
||||||
|
public function getLintName() {
|
||||||
|
return pht('`%s` Statement Must Be The First Statement', 'namespace');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function process(XHPASTNode $root) {
|
||||||
|
$namespaces = $root->selectDescendantsOfType('n_NAMESPACE');
|
||||||
|
|
||||||
|
if (!count($namespaces)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$statements = $root->getChildOfType(0, 'n_STATEMENT_LIST');
|
||||||
|
|
||||||
|
// Ignore the first statement, which should be `n_OPEN_TAG`.
|
||||||
|
$second_statement = $statements->getChildByIndex(1)->getChildByIndex(0);
|
||||||
|
|
||||||
|
if ($second_statement->getTypeName() != 'n_NAMESPACE') {
|
||||||
|
$this->raiseLintAtNode(
|
||||||
|
$second_statement,
|
||||||
|
pht(
|
||||||
|
'A script which contains a `%s` statement expects the very first '.
|
||||||
|
'statement to be a `%s` statement. Otherwise, a PHP fatal error '.
|
||||||
|
'will occur. %s',
|
||||||
|
'namespace',
|
||||||
|
'namespace', $second_statement->getTypeName()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -20,7 +20,7 @@ final class ArcanistNamingConventionsXHPASTLinterRule
|
||||||
'xhpast.naminghook' => array(
|
'xhpast.naminghook' => array(
|
||||||
'type' => 'optional string',
|
'type' => 'optional string',
|
||||||
'help' => pht(
|
'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.',
|
'granular naming convention rules for symbols.',
|
||||||
'ArcanistXHPASTLintNamingHook'),
|
'ArcanistXHPASTLintNamingHook'),
|
||||||
),
|
),
|
||||||
|
@ -56,8 +56,8 @@ final class ArcanistNamingConventionsXHPASTLinterRule
|
||||||
ArcanistXHPASTLintNamingHook::isUpperCamelCase($name_string)
|
ArcanistXHPASTLintNamingHook::isUpperCamelCase($name_string)
|
||||||
? null
|
? null
|
||||||
: pht(
|
: pht(
|
||||||
'Follow naming conventions: classes should be named using '.
|
'Follow naming conventions: classes should be named using `%s`.',
|
||||||
'UpperCamelCase.'),
|
'UpperCamelCase'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,8 +72,8 @@ final class ArcanistNamingConventionsXHPASTLinterRule
|
||||||
ArcanistXHPASTLintNamingHook::isUpperCamelCase($name_string)
|
ArcanistXHPASTLintNamingHook::isUpperCamelCase($name_string)
|
||||||
? null
|
? null
|
||||||
: pht(
|
: pht(
|
||||||
'Follow naming conventions: interfaces should be named using '.
|
'Follow naming conventions: interfaces should be named using `%s`.',
|
||||||
'UpperCamelCase.'),
|
'UpperCamelCase'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,8 +94,8 @@ final class ArcanistNamingConventionsXHPASTLinterRule
|
||||||
ArcanistXHPASTLintNamingHook::stripPHPFunction($name_string))
|
ArcanistXHPASTLintNamingHook::stripPHPFunction($name_string))
|
||||||
? null
|
? null
|
||||||
: pht(
|
: pht(
|
||||||
'Follow naming conventions: functions should be named using '.
|
'Follow naming conventions: functions should be named using `%s`.',
|
||||||
'lowercase_with_underscores.'),
|
'lowercase_with_underscores'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,8 +112,8 @@ final class ArcanistNamingConventionsXHPASTLinterRule
|
||||||
ArcanistXHPASTLintNamingHook::stripPHPFunction($name_string))
|
ArcanistXHPASTLintNamingHook::stripPHPFunction($name_string))
|
||||||
? null
|
? null
|
||||||
: pht(
|
: pht(
|
||||||
'Follow naming conventions: methods should be named using '.
|
'Follow naming conventions: methods should be named using `%s`.',
|
||||||
'lowerCamelCase.'),
|
'lowerCamelCase'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,8 +137,9 @@ final class ArcanistNamingConventionsXHPASTLinterRule
|
||||||
ArcanistXHPASTLintNamingHook::stripPHPVariable($name_string))
|
ArcanistXHPASTLintNamingHook::stripPHPVariable($name_string))
|
||||||
? null
|
? null
|
||||||
: pht(
|
: pht(
|
||||||
'Follow naming conventions: parameters should be named using '.
|
'Follow naming conventions: parameters '.
|
||||||
'lowercase_with_underscores.'),
|
'should be named using `%s`',
|
||||||
|
'lowercase_with_underscores'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -157,8 +158,9 @@ final class ArcanistNamingConventionsXHPASTLinterRule
|
||||||
ArcanistXHPASTLintNamingHook::isUppercaseWithUnderscores($name_string)
|
ArcanistXHPASTLintNamingHook::isUppercaseWithUnderscores($name_string)
|
||||||
? null
|
? null
|
||||||
: pht(
|
: pht(
|
||||||
'Follow naming conventions: class constants should be named '.
|
'Follow naming conventions: class constants '.
|
||||||
'using UPPERCASE_WITH_UNDERSCORES.'),
|
'should be named using `%s`',
|
||||||
|
'UPPERCASE_WITH_UNDERSCORES'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -184,8 +186,9 @@ final class ArcanistNamingConventionsXHPASTLinterRule
|
||||||
ArcanistXHPASTLintNamingHook::stripPHPVariable($name_string))
|
ArcanistXHPASTLintNamingHook::stripPHPVariable($name_string))
|
||||||
? null
|
? null
|
||||||
: pht(
|
: pht(
|
||||||
'Follow naming conventions: class properties should be named '.
|
'Follow naming conventions: class properties '.
|
||||||
'using lowerCamelCase.'),
|
'should be named using `%s`.',
|
||||||
|
'lowerCamelCase'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -269,8 +272,9 @@ final class ArcanistNamingConventionsXHPASTLinterRule
|
||||||
ArcanistXHPASTLintNamingHook::stripPHPVariable($var_string))
|
ArcanistXHPASTLintNamingHook::stripPHPVariable($var_string))
|
||||||
? null
|
? null
|
||||||
: pht(
|
: pht(
|
||||||
'Follow naming conventions: variables should be named using '.
|
'Follow naming conventions: variables '.
|
||||||
'lowercase_with_underscores.'),
|
'should be named using `%s`.',
|
||||||
|
'lowercase_with_underscores'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,9 @@ final class ArcanistNewlineAfterOpenTagXHPASTLinterRule
|
||||||
$next = $token->getNextToken();
|
$next = $token->getNextToken();
|
||||||
$this->raiseLintAtToken(
|
$this->raiseLintAtToken(
|
||||||
$next,
|
$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());
|
"\n".$next->getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ final class ArcanistNoParentScopeXHPASTLinterRule
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$static_access,
|
$static_access,
|
||||||
pht(
|
pht(
|
||||||
'Cannot access %s when current class scope has no parent.',
|
'Cannot access `%s` when current class scope has no parent.',
|
||||||
'parent::'));
|
'parent::'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ final class ArcanistPHPCloseTagXHPASTLinterRule
|
||||||
const ID = 8;
|
const ID = 8;
|
||||||
|
|
||||||
public function getLintName() {
|
public function getLintName() {
|
||||||
return pht('Use of Close Tag "%s"', '?>');
|
return pht('Use of Close Tag `%s`', '?>');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function process(XHPASTNode $root) {
|
public function process(XHPASTNode $root) {
|
||||||
|
@ -19,7 +19,9 @@ final class ArcanistPHPCloseTagXHPASTLinterRule
|
||||||
foreach ($root->selectTokensOfType('T_CLOSE_TAG') as $token) {
|
foreach ($root->selectTokensOfType('T_CLOSE_TAG') as $token) {
|
||||||
$this->raiseLintAtToken(
|
$this->raiseLintAtToken(
|
||||||
$token,
|
$token,
|
||||||
pht('Do not use the PHP closing tag, "%s".', '?>'));
|
pht(
|
||||||
|
'Do not use the PHP closing tag, `%s`.',
|
||||||
|
'?>'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ final class ArcanistPHPEchoTagXHPASTLinterRule
|
||||||
const ID = 7;
|
const ID = 7;
|
||||||
|
|
||||||
public function getLintName() {
|
public function getLintName() {
|
||||||
return pht('Use of Echo Tag "%s"', '<?=');
|
return pht('Use of Echo Tag `%s`', '<?=');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function process(XHPASTNode $root) {
|
public function process(XHPASTNode $root) {
|
||||||
|
@ -16,7 +16,9 @@ final class ArcanistPHPEchoTagXHPASTLinterRule
|
||||||
if ($token->getTypeName() === 'T_OPEN_TAG_WITH_ECHO') {
|
if ($token->getTypeName() === 'T_OPEN_TAG_WITH_ECHO') {
|
||||||
$this->raiseLintAtToken(
|
$this->raiseLintAtToken(
|
||||||
$token,
|
$token,
|
||||||
pht('Avoid the PHP echo short form, "%s".', '<?='));
|
pht(
|
||||||
|
'Avoid the PHP echo short form, `%s`.',
|
||||||
|
'<?='));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,8 +22,8 @@ final class ArcanistPHPOpenTagXHPASTLinterRule
|
||||||
$this->raiseLintAtToken(
|
$this->raiseLintAtToken(
|
||||||
$token,
|
$token,
|
||||||
pht(
|
pht(
|
||||||
'PHP files should start with "%s", which may be preceded by '.
|
'PHP files should start with `%s`, which may be preceded by '.
|
||||||
'a "%s" line for scripts.',
|
'a `%s` line for scripts.',
|
||||||
'<?php',
|
'<?php',
|
||||||
'#!'));
|
'#!'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ final class ArcanistPHPShortTagXHPASTLinterRule
|
||||||
const ID = 6;
|
const ID = 6;
|
||||||
|
|
||||||
public function getLintName() {
|
public function getLintName() {
|
||||||
return pht('Use of Short Tag "%s"', '<?');
|
return pht('Use of Short Tag `%s`', '<?');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function process(XHPASTNode $root) {
|
public function process(XHPASTNode $root) {
|
||||||
|
@ -18,7 +18,7 @@ final class ArcanistPHPShortTagXHPASTLinterRule
|
||||||
$this->raiseLintAtToken(
|
$this->raiseLintAtToken(
|
||||||
$token,
|
$token,
|
||||||
pht(
|
pht(
|
||||||
'Use the full form of the PHP open tag, "%s".',
|
'Use the full form of the PHP open tag, `%s`.',
|
||||||
'<?php'),
|
'<?php'),
|
||||||
"<?php\n");
|
"<?php\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ final class ArcanistParseStrUseXHPASTLinterRule
|
||||||
const ID = 80;
|
const ID = 80;
|
||||||
|
|
||||||
public function getLintName() {
|
public function getLintName() {
|
||||||
return pht('Questionable Use of %s', 'parse_str()');
|
return pht('Questionable Use of `%s`', 'parse_str');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function process(XHPASTNode $root) {
|
public function process(XHPASTNode $root) {
|
||||||
|
@ -19,9 +19,9 @@ final class ArcanistParseStrUseXHPASTLinterRule
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$call,
|
$call,
|
||||||
pht(
|
pht(
|
||||||
'Avoid %s unless the second parameter is specified. '.
|
'Avoid `%s` unless the second parameter is specified. '.
|
||||||
'It is confusing and hinders static analysis.',
|
'It is confusing and hinders static analysis.',
|
||||||
'parse_str()'));
|
'parse_str'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,9 +26,10 @@ final class ArcanistPlusOperatorOnStringsXHPASTLinterRule
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$binop,
|
$binop,
|
||||||
pht(
|
pht(
|
||||||
"In PHP, '%s' is the string concatenation operator, not '%s'. ".
|
'In PHP, `%s` is the string concatenation operator, not `%s`. '.
|
||||||
"This expression uses '+' with a string literal as an operand.",
|
'This expression uses `%s` with a string literal as an operand.',
|
||||||
'.',
|
'.',
|
||||||
|
'+',
|
||||||
'+'));
|
'+'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ final class ArcanistPregQuoteMisuseXHPASTLinterRule
|
||||||
const ID = 14;
|
const ID = 14;
|
||||||
|
|
||||||
public function getLintName() {
|
public function getLintName() {
|
||||||
return pht('Misuse of %s', 'preg_quote()');
|
return pht('Misuse of `%s`', 'preg_quote');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLintSeverity() {
|
public function getLintSeverity() {
|
||||||
|
@ -33,8 +33,8 @@ final class ArcanistPregQuoteMisuseXHPASTLinterRule
|
||||||
'arguments to %s, so that %s knows which delimiter to escape.',
|
'arguments to %s, so that %s knows which delimiter to escape.',
|
||||||
'//',
|
'//',
|
||||||
'()',
|
'()',
|
||||||
'preg_quote()',
|
'preg_quote',
|
||||||
'preg_quote()'));
|
'preg_quote'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ final class ArcanistRaggedClassTreeEdgeXHPASTLinterRule
|
||||||
const ID = 87;
|
const ID = 87;
|
||||||
|
|
||||||
public function getLintName() {
|
public function getLintName() {
|
||||||
return pht('Class Not %s Or %s', 'abstract', 'final');
|
return pht('Class Not `%s` Or `%s`', 'abstract', 'final');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLintSeverity() {
|
public function getLintSeverity() {
|
||||||
|
@ -42,8 +42,8 @@ final class ArcanistRaggedClassTreeEdgeXHPASTLinterRule
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$class->getChildOfType(1, 'n_CLASS_NAME'),
|
$class->getChildOfType(1, 'n_CLASS_NAME'),
|
||||||
pht(
|
pht(
|
||||||
"This class is neither '%s' nor '%s', and does not have ".
|
'This class is neither `%s` nor `%s`, and does not have '.
|
||||||
"a docblock marking it '%s'.",
|
'a docblock marking it `%s`.',
|
||||||
'final',
|
'final',
|
||||||
'abstract',
|
'abstract',
|
||||||
'@concrete-extensible'));
|
'@concrete-extensible'));
|
||||||
|
|
|
@ -173,7 +173,7 @@ final class ArcanistReusedIteratorReferenceXHPASTLinterRule
|
||||||
$var,
|
$var,
|
||||||
pht(
|
pht(
|
||||||
'This variable was used already as a by-reference iterator '.
|
'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.',
|
'do not reuse.',
|
||||||
'foreach'));
|
'foreach'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,14 +51,14 @@ final class ArcanistSlownessXHPASTLinterRule
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$strstr,
|
$strstr,
|
||||||
pht(
|
pht(
|
||||||
'Use %s for checking if the string contains something.',
|
'Use `%s` for checking if the string contains something.',
|
||||||
'strpos()'));
|
'strpos'));
|
||||||
} else if ($name === 'stristr') {
|
} else if ($name === 'stristr') {
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$strstr,
|
$strstr,
|
||||||
pht(
|
pht(
|
||||||
'Use %s for checking if the string contains something.',
|
'Use `%s` for checking if the string contains something.',
|
||||||
'stripos()'));
|
'stripos'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,14 +96,14 @@ final class ArcanistSlownessXHPASTLinterRule
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$strpos,
|
$strpos,
|
||||||
pht(
|
pht(
|
||||||
'Use %s for checking if the string starts with something.',
|
'Use `%s` for checking if the string starts with something.',
|
||||||
'strncmp()'));
|
'strncmp'));
|
||||||
} else if ($name === 'stripos') {
|
} else if ($name === 'stripos') {
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$strpos,
|
$strpos,
|
||||||
pht(
|
pht(
|
||||||
'Use %s for checking if the string starts with something.',
|
'Use `%s` for checking if the string starts with something.',
|
||||||
'strncasecmp()'));
|
'strncasecmp'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ final class ArcanistStaticThisXHPASTLinterRule
|
||||||
const ID = 13;
|
const ID = 13;
|
||||||
|
|
||||||
public function getLintName() {
|
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) {
|
public function process(XHPASTNode $root) {
|
||||||
|
|
|
@ -6,7 +6,7 @@ final class ArcanistToStringExceptionXHPASTLinterRule
|
||||||
const ID = 67;
|
const ID = 67;
|
||||||
|
|
||||||
public function getLintName() {
|
public function getLintName() {
|
||||||
return pht('Throwing Exception in %s Method', '__toString');
|
return pht('Throwing Exception in `%s` Method', '__toString');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function process(XHPASTNode $root) {
|
public function process(XHPASTNode $root) {
|
||||||
|
@ -33,7 +33,7 @@ final class ArcanistToStringExceptionXHPASTLinterRule
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$throw,
|
$throw,
|
||||||
pht(
|
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',
|
'Exception',
|
||||||
'__toString'));
|
'__toString'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,10 @@ final class ArcanistUnexpectedReturnValueXHPASTLinterRule
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->isInAnonymousFunction($return)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$return,
|
$return,
|
||||||
pht(
|
pht(
|
||||||
|
@ -45,4 +49,15 @@ final class ArcanistUnexpectedReturnValueXHPASTLinterRule
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function isInAnonymousFunction(XHPASTNode $node) {
|
||||||
|
while ($node) {
|
||||||
|
if ($node->getTypeName() == 'n_FUNCTION_DECLARATION' &&
|
||||||
|
$node->getChildByIndex(2)->getTypeName() == 'n_EMPTY') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$node = $node->getParentNode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ final class ArcanistUnnecessaryFinalModifierXHPASTLinterRule
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$attribute,
|
$attribute,
|
||||||
pht(
|
pht(
|
||||||
'Unnecessary %s modifier in %s class.',
|
'Unnecessary `%s` modifier in `%s` class.',
|
||||||
'final',
|
'final',
|
||||||
'final'));
|
'final'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class ArcanistUnnecessarySymbolAliasXHPASTLinterRule
|
||||||
|
extends ArcanistXHPASTLinterRule {
|
||||||
|
|
||||||
|
const ID = 99;
|
||||||
|
|
||||||
|
public function getLintName() {
|
||||||
|
return pht('Unnecessary Symbol Alias');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getLintSeverity() {
|
||||||
|
return ArcanistLintSeverity::SEVERITY_WARNING;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function process(XHPASTNode $root) {
|
||||||
|
$uses = $root->selectDescendantsOfType('n_USE');
|
||||||
|
|
||||||
|
foreach ($uses as $use) {
|
||||||
|
$symbol = $use->getChildOfType(0, 'n_SYMBOL_NAME');
|
||||||
|
$alias = $use->getChildByIndex(1);
|
||||||
|
|
||||||
|
if ($alias->getTypeName() == 'n_EMPTY') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$symbol_name = last(explode('\\', $symbol->getConcreteString()));
|
||||||
|
$alias_name = $alias->getConcreteString();
|
||||||
|
|
||||||
|
if ($symbol_name == $alias_name) {
|
||||||
|
$this->raiseLintAtNode(
|
||||||
|
$use,
|
||||||
|
pht(
|
||||||
|
'Importing `%s` with `%s` is unnecessary because the aliased '.
|
||||||
|
'name is identical to the imported symbol name.',
|
||||||
|
$symbol->getConcreteString(),
|
||||||
|
sprintf('as %s', $alias_name)),
|
||||||
|
$symbol->getConcreteString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -70,9 +70,11 @@ final class ArcanistUnsafeDynamicStringXHPASTLinterRule
|
||||||
AASTNodeList $calls,
|
AASTNodeList $calls,
|
||||||
array $safe) {
|
array $safe) {
|
||||||
|
|
||||||
$safe = array_combine(
|
if ($safe) {
|
||||||
array_map('strtolower', array_keys($safe)),
|
$safe = array_combine(
|
||||||
$safe);
|
array_map('strtolower', array_keys($safe)),
|
||||||
|
$safe);
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($calls as $call) {
|
foreach ($calls as $call) {
|
||||||
$name = $call->getChildByIndex(0)->getConcreteString();
|
$name = $call->getChildByIndex(0)->getConcreteString();
|
||||||
|
@ -92,10 +94,10 @@ final class ArcanistUnsafeDynamicStringXHPASTLinterRule
|
||||||
$this->raiseLintAtNode(
|
$this->raiseLintAtNode(
|
||||||
$call,
|
$call,
|
||||||
pht(
|
pht(
|
||||||
"Parameter %d of %s should be a scalar string, ".
|
"Parameter %d of `%s` should be a scalar string, ".
|
||||||
"otherwise it's not safe.",
|
"otherwise it's not safe.",
|
||||||
$param + 1,
|
$param + 1,
|
||||||
$name.'()'));
|
$name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class ArcanistUseStatementNamespacePrefixXHPASTLinterRule
|
||||||
|
extends ArcanistXHPASTLinterRule {
|
||||||
|
|
||||||
|
const ID = 97;
|
||||||
|
|
||||||
|
public function getLintName() {
|
||||||
|
return pht('`%s` Statement Namespace Prefix', 'use');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getLintSeverity() {
|
||||||
|
return ArcanistLintSeverity::SEVERITY_WARNING;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function process(XHPASTNode $root) {
|
||||||
|
$use_lists = $root->selectDescendantsOfType('n_USE_LIST');
|
||||||
|
|
||||||
|
foreach ($use_lists as $use_list) {
|
||||||
|
$uses = $use_list->selectDescendantsOfType('n_USE');
|
||||||
|
|
||||||
|
foreach ($uses as $use) {
|
||||||
|
$symbol = $use->getChildOfType(0, 'n_SYMBOL_NAME');
|
||||||
|
$symbol_name = $symbol->getConcreteString();
|
||||||
|
|
||||||
|
if ($symbol_name[0] == '\\') {
|
||||||
|
$this->raiseLintAtNode(
|
||||||
|
$symbol,
|
||||||
|
pht(
|
||||||
|
'Imported symbols should not be prefixed with `%s`.',
|
||||||
|
'\\'),
|
||||||
|
substr($symbol_name, 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class ArcanistAbstractMethodBodyXHPASTLinterRuleTestCase
|
||||||
|
extends ArcanistXHPASTLinterRuleTestCase {
|
||||||
|
|
||||||
|
public function testLinter() {
|
||||||
|
$this->executeTestsInDirectory(dirname(__FILE__).'/abstract-method-body/');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class ArcanistAbstractPrivateMethodXHPASTLinterRuleTestCase
|
||||||
|
extends ArcanistXHPASTLinterRuleTestCase {
|
||||||
|
|
||||||
|
public function testLinter() {
|
||||||
|
$this->executeTestsInDirectory(
|
||||||
|
dirname(__FILE__).'/abstract-private-method/');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class ArcanistClassMustBeDeclaredAbstractXHPASTLinterRuleTestCase
|
||||||
|
extends ArcanistXHPASTLinterRuleTestCase {
|
||||||
|
|
||||||
|
public function testLinter() {
|
||||||
|
$this->executeTestsInDirectory(
|
||||||
|
dirname(__FILE__).'/class-must-be-declared-abstract/');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class ArcanistInterfaceAbstractMethodXHPASTLinterRuleTestCase
|
||||||
|
extends ArcanistXHPASTLinterRuleTestCase {
|
||||||
|
|
||||||
|
public function testLinter() {
|
||||||
|
$this->executeTestsInDirectory(
|
||||||
|
dirname(__FILE__).'/interface-abstract-method/');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class ArcanistInterfaceMethodBodyXHPASTLinterRuleTestCase
|
||||||
|
extends ArcanistXHPASTLinterRuleTestCase {
|
||||||
|
|
||||||
|
public function testLinter() {
|
||||||
|
$this->executeTestsInDirectory(dirname(__FILE__).'/interface-method-body/');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class ArcanistNamespaceFirstStatementXHPASTLinterRuleTestCase
|
||||||
|
extends ArcanistXHPASTLinterRuleTestCase {
|
||||||
|
|
||||||
|
public function testLinter() {
|
||||||
|
$this->executeTestsInDirectory(
|
||||||
|
dirname(__FILE__).'/namespace-first-statement/');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class ArcanistUnnecessarySymbolAliasXHPASTLinterRuleTestCase
|
||||||
|
extends ArcanistXHPASTLinterRuleTestCase {
|
||||||
|
|
||||||
|
public function testLinter() {
|
||||||
|
$this->executeTestsInDirectory(
|
||||||
|
dirname(__FILE__).'/unnecessary-symbol-alias/');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class ArcanistUseStatementNamespacePrefixXHPASTLinterRuleTestCase
|
||||||
|
extends ArcanistXHPASTLinterRuleTestCase {
|
||||||
|
|
||||||
|
public function testLinter() {
|
||||||
|
$this->executeTestsInDirectory(
|
||||||
|
dirname(__FILE__).'/use-statement-namespace-prefix/');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?php
|
||||||
|
abstract class SomeClass {
|
||||||
|
abstract public function someMethod() {}
|
||||||
|
}
|
||||||
|
~~~~~~~~~~
|
||||||
|
error:3:41
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?php
|
||||||
|
abstract class SomeClass {
|
||||||
|
abstract public function someMethod();
|
||||||
|
}
|
||||||
|
~~~~~~~~~~
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?php
|
||||||
|
abstract class SomeClass {
|
||||||
|
public function someMethod() {}
|
||||||
|
}
|
||||||
|
~~~~~~~~~~
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?php
|
||||||
|
abstract class SomeClass {
|
||||||
|
private abstract function someMethod();
|
||||||
|
}
|
||||||
|
~~~~~~~~~~
|
||||||
|
error:3:3
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?php
|
||||||
|
abstract class SomeClass {
|
||||||
|
abstract public function someMethod();
|
||||||
|
}
|
||||||
|
~~~~~~~~~~
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?php
|
||||||
|
class SomeClass {
|
||||||
|
public function someMethod();
|
||||||
|
}
|
||||||
|
~~~~~~~~~~
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?php
|
||||||
|
class SomeClass {
|
||||||
|
abstract public function someMethod();
|
||||||
|
}
|
||||||
|
~~~~~~~~~~
|
||||||
|
error:2:1
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
interface SomeInterface {
|
||||||
|
abstract public function someMethod();
|
||||||
|
}
|
||||||
|
~~~~~~~~~~
|
||||||
|
error:4:3
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
interface SomeInterface {
|
||||||
|
public function someMethod();
|
||||||
|
}
|
||||||
|
~~~~~~~~~~
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
interface SomeInterface {
|
||||||
|
public function someMethod() {}
|
||||||
|
}
|
||||||
|
~~~~~~~~~~
|
||||||
|
error:4:32
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
interface SomeInterface {
|
||||||
|
public function someMethod();
|
||||||
|
}
|
||||||
|
~~~~~~~~~~
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?php
|
||||||
|
class X {}
|
||||||
|
namespace X;
|
||||||
|
~~~~~~~~~~
|
||||||
|
error:2:1
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is actually perfectly valid, for some unknown reason.
|
||||||
|
*
|
||||||
|
* TODO: Maybe fix the handling of this edge case.
|
||||||
|
*/
|
||||||
|
|
||||||
|
1;
|
||||||
|
|
||||||
|
namespace X {
|
||||||
|
class C { }
|
||||||
|
echo 2;
|
||||||
|
}
|
||||||
|
~~~~~~~~~~
|
||||||
|
error:9:1
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?php
|
||||||
|
namespace X;
|
||||||
|
class X {}
|
||||||
|
|
||||||
|
namespace Y;
|
||||||
|
class Y {}
|
||||||
|
~~~~~~~~~~
|
|
@ -0,0 +1,3 @@
|
||||||
|
<?php
|
||||||
|
class X {}
|
||||||
|
~~~~~~~~~~
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
class SomeClass {
|
||||||
|
private $closure;
|
||||||
|
|
||||||
|
public function __construct() {
|
||||||
|
$this->closure = function() {
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
~~~~~~~~~~
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?php
|
||||||
|
use A;
|
||||||
|
use B as B;
|
||||||
|
use C as D;
|
||||||
|
use E\F as F;
|
||||||
|
use G\H as I;
|
||||||
|
~~~~~~~~~~
|
||||||
|
warning:3:5
|
||||||
|
warning:5:5
|
||||||
|
~~~~~~~~~~
|
||||||
|
<?php
|
||||||
|
use A;
|
||||||
|
use B;
|
||||||
|
use C as D;
|
||||||
|
use E\F;
|
||||||
|
use G\H as I;
|
|
@ -0,0 +1,11 @@
|
||||||
|
<?php
|
||||||
|
namespace SomeNamespace;
|
||||||
|
use X\Y\Z;
|
||||||
|
use \X\Y\Z;
|
||||||
|
~~~~~~~~~~
|
||||||
|
warning:4:5
|
||||||
|
~~~~~~~~~~
|
||||||
|
<?php
|
||||||
|
namespace SomeNamespace;
|
||||||
|
use X\Y\Z;
|
||||||
|
use X\Y\Z;
|
|
@ -521,6 +521,16 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRemoteURI() {
|
public function getRemoteURI() {
|
||||||
|
// Determine which remote to examine; default to 'origin'
|
||||||
|
$remote = 'origin';
|
||||||
|
$branch = $this->getBranchName();
|
||||||
|
if ($branch) {
|
||||||
|
$path = $this->getPathToUpstream($branch);
|
||||||
|
if ($path->isConnectedToRemote()) {
|
||||||
|
$remote = $path->getRemoteRemoteName();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// "git ls-remote --get-url" is the appropriate plumbing to get the remote
|
// "git ls-remote --get-url" is the appropriate plumbing to get the remote
|
||||||
// URI. "git config remote.origin.url", on the other hand, may not be as
|
// URI. "git config remote.origin.url", on the other hand, may not be as
|
||||||
// accurate (for example, it does not take into account possible URL
|
// accurate (for example, it does not take into account possible URL
|
||||||
|
@ -528,9 +538,9 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
|
||||||
// the --get-url flag requires git 1.7.5.
|
// the --get-url flag requires git 1.7.5.
|
||||||
$version = $this->getGitVersion();
|
$version = $this->getGitVersion();
|
||||||
if (version_compare($version, '1.7.5', '>=')) {
|
if (version_compare($version, '1.7.5', '>=')) {
|
||||||
list($stdout) = $this->execxLocal('ls-remote --get-url origin');
|
list($stdout) = $this->execxLocal('ls-remote --get-url %s', $remote);
|
||||||
} else {
|
} else {
|
||||||
list($stdout) = $this->execxLocal('config remote.origin.url');
|
list($stdout) = $this->execxLocal('config %s', "remote.{$remote}.url");
|
||||||
}
|
}
|
||||||
|
|
||||||
$uri = rtrim($stdout);
|
$uri = rtrim($stdout);
|
||||||
|
|
|
@ -56,9 +56,11 @@ EOTEXT
|
||||||
|
|
||||||
$config = $configuration_manager->readUserConfigurationFile();
|
$config = $configuration_manager->readUserConfigurationFile();
|
||||||
|
|
||||||
$console->writeOut(
|
$this->writeInfo(
|
||||||
"%s\n",
|
pht('CONNECT'),
|
||||||
pht('Trying to connect to server...'));
|
pht(
|
||||||
|
'Connecting to "%s"...',
|
||||||
|
$uri));
|
||||||
|
|
||||||
$conduit = $this->establishConduit()->getConduit();
|
$conduit = $this->establishConduit()->getConduit();
|
||||||
try {
|
try {
|
||||||
|
@ -194,10 +196,19 @@ EOTEXT
|
||||||
$uri = $conduit_uri;
|
$uri = $conduit_uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
$uri = new PhutilURI($uri);
|
$uri_object = new PhutilURI($uri);
|
||||||
$uri->setPath('/api/');
|
if (!$uri_object->getProtocol() || !$uri_object->getDomain()) {
|
||||||
|
throw new ArcanistUsageException(
|
||||||
|
pht(
|
||||||
|
'Server URI "%s" must include a protocol and domain. It should be '.
|
||||||
|
'in the form "%s".',
|
||||||
|
$uri,
|
||||||
|
'https://phabricator.example.com/'));
|
||||||
|
}
|
||||||
|
|
||||||
return (string)$uri;
|
$uri_object->setPath('/api/');
|
||||||
|
|
||||||
|
return (string)$uri_object;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1282,10 +1282,16 @@ EOTEXT
|
||||||
$err = $repository_api->execPassthru('push %s', $this->remote);
|
$err = $repository_api->execPassthru('push %s', $this->remote);
|
||||||
$cmd = 'hg push';
|
$cmd = 'hg push';
|
||||||
} else if ($this->isHg) {
|
} else if ($this->isHg) {
|
||||||
$err = $repository_api->execPassthru(
|
if (strlen($this->remote)) {
|
||||||
'push -r %s %s',
|
$err = $repository_api->execPassthru(
|
||||||
$this->onto,
|
'push -r %s %s',
|
||||||
$this->remote);
|
$this->onto,
|
||||||
|
$this->remote);
|
||||||
|
} else {
|
||||||
|
$err = $repository_api->execPassthru(
|
||||||
|
'push -r %s',
|
||||||
|
$this->onto);
|
||||||
|
}
|
||||||
$cmd = 'hg push';
|
$cmd = 'hg push';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue