Page MenuHomePhabricator

D11450.id27525.diff
No OneTemporary

D11450.id27525.diff

diff --git a/src/lint/linter/__tests__/ArcanistLinterTestCase.php b/src/lint/linter/__tests__/ArcanistLinterTestCase.php
--- a/src/lint/linter/__tests__/ArcanistLinterTestCase.php
+++ b/src/lint/linter/__tests__/ArcanistLinterTestCase.php
@@ -11,20 +11,13 @@
* @return ArcanistLinter
*/
protected final function getLinter() {
- $matches = array();
-
- if (!preg_match('/^(\w+Linter)TestCase$/', get_class($this), $matches)) {
- throw new Exception(pht('Unable to infer linter class name.'));
- }
-
- $linter = id(new ReflectionClass($matches[1]))
- ->newInstanceWithoutConstructor();
-
- if (!$linter instanceof ArcanistLinter) {
+ $matches = null;
+ if (!preg_match('/^(\w+Linter)TestCase$/', get_class($this), $matches) ||
+ !is_subclass_of($matches[1], 'ArcanistLinter')) {
throw new Exception(pht('Unable to infer linter class name.'));
}
- return $linter;
+ return newv($matches[1], array());
}
public abstract function testLinter();

File Metadata

Mime Type
text/plain
Expires
Wed, Apr 16, 3:17 AM (3 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7719573
Default Alt Text
D11450.id27525.diff (1017 B)

Event Timeline