mirror of
https://we.phorge.it/source/arcanist.git
synced 2024-11-22 14:52:40 +01:00
Remove "commit hook mode" workarounds for ArcanistXHPASTLinter
Summary: Ref T7674. `ArcanistXHPASTLinter` has some workarounds for running in "commit hook" mode (which has since been removed). This linter should always have a working copy. Test Plan: `arc unit` Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, epriestley Maniphest Tasks: T7674 Differential Revision: https://secure.phabricator.com/D12956
This commit is contained in:
parent
af343e4ca6
commit
e72a43a992
1 changed files with 14 additions and 21 deletions
|
@ -957,13 +957,11 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter {
|
||||||
|
|
||||||
private function lintImplicitFallthrough(XHPASTNode $root) {
|
private function lintImplicitFallthrough(XHPASTNode $root) {
|
||||||
$hook_obj = null;
|
$hook_obj = null;
|
||||||
$working_copy = $this->getEngine()->getWorkingCopy();
|
|
||||||
if ($working_copy) {
|
$hook_class = $this->switchhook;
|
||||||
$hook_class = $this->switchhook;
|
if ($hook_class) {
|
||||||
if ($hook_class) {
|
$hook_obj = newv($hook_class, array());
|
||||||
$hook_obj = newv($hook_class, array());
|
assert_instances_of(array($hook_obj), 'ArcanistXHPASTLintSwitchHook');
|
||||||
assert_instances_of(array($hook_obj), 'ArcanistXHPASTLintSwitchHook');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$switches = $root->selectDescendantsOfType('n_SWITCH');
|
$switches = $root->selectDescendantsOfType('n_SWITCH');
|
||||||
|
@ -2253,20 +2251,15 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$engine = $this->getEngine();
|
// If a naming hook is configured, give it a chance to override the
|
||||||
$working_copy = $engine->getWorkingCopy();
|
// default results for all the symbol names.
|
||||||
|
$hook_class = $this->naminghook;
|
||||||
if ($working_copy) {
|
if ($hook_class) {
|
||||||
// If a naming hook is configured, give it a chance to override the
|
$hook_obj = newv($hook_class, array());
|
||||||
// default results for all the symbol names.
|
foreach ($names as $k => $name_attrs) {
|
||||||
$hook_class = $this->naminghook;
|
list($type, $name, $token, $default) = $name_attrs;
|
||||||
if ($hook_class) {
|
$result = $hook_obj->lintSymbolName($type, $name, $default);
|
||||||
$hook_obj = newv($hook_class, array());
|
$names[$k][3] = $result;
|
||||||
foreach ($names as $k => $name_attrs) {
|
|
||||||
list($type, $name, $token, $default) = $name_attrs;
|
|
||||||
$result = $hook_obj->lintSymbolName($type, $name, $default);
|
|
||||||
$names[$k][3] = $result;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue