mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Simplify clearCache calls
This commit is contained in:
parent
faae9062ba
commit
84b4e09873
@ -124,4 +124,14 @@ class ClassChecker extends ClassLikeChecker
|
||||
|
||||
return isset($class_implementations[$interface]);
|
||||
}
|
||||
|
||||
public static function clearCache()
|
||||
{
|
||||
self::$existing_classes = [];
|
||||
self::$existing_classes_ci = [];
|
||||
|
||||
self::$class_extends = [];
|
||||
|
||||
ClassMethodChecker::clearCache();
|
||||
}
|
||||
}
|
||||
|
@ -755,9 +755,6 @@ abstract class ClassLikeChecker implements StatementsSource
|
||||
|
||||
self::$this_class = null;
|
||||
|
||||
self::$existing_classes = [];
|
||||
self::$existing_classes_ci = [];
|
||||
self::$existing_interfaces_ci = [];
|
||||
self::$class_implements = [];
|
||||
|
||||
self::$class_methods = [];
|
||||
@ -771,6 +768,7 @@ abstract class ClassLikeChecker implements StatementsSource
|
||||
self::$protected_static_class_properties = [];
|
||||
self::$private_static_class_properties = [];
|
||||
|
||||
self::$class_extends = [];
|
||||
ClassChecker::clearCache();
|
||||
InterfaceChecker::clearCache();
|
||||
}
|
||||
}
|
||||
|
@ -385,6 +385,5 @@ class ClassMethodChecker extends FunctionLikeChecker
|
||||
self::$inherited_methods = [];
|
||||
self::$declaring_class = [];
|
||||
self::$method_visibility = [];
|
||||
self::$new_docblocks = [];
|
||||
}
|
||||
}
|
||||
|
@ -361,5 +361,7 @@ class FileChecker implements StatementsSource
|
||||
self::$functions_checked = [];
|
||||
self::$classes_checked = [];
|
||||
self::$file_checked = [];
|
||||
|
||||
ClassLikeChecker::clearCache();
|
||||
}
|
||||
}
|
||||
|
@ -57,4 +57,10 @@ class InterfaceChecker extends ClassLikeChecker
|
||||
|
||||
return isset(self::$existing_interfaces[$absolute_class]);
|
||||
}
|
||||
|
||||
public static function clearCache()
|
||||
{
|
||||
self::$existing_interfaces = [];
|
||||
self::$existing_interfaces_ci = [];
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ class ArrayReturnTypeTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
\Psalm\Checker\ClassMethodChecker::clearCache();
|
||||
\Psalm\Checker\FileChecker::clearCache();
|
||||
}
|
||||
|
||||
public function testGenericArrayCreation()
|
||||
|
@ -29,8 +29,7 @@ class IssueSuppressionTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
\Psalm\Checker\ClassLikeChecker::clearCache();
|
||||
\Psalm\Checker\ClassMethodChecker::clearCache();
|
||||
\Psalm\Checker\FileChecker::clearCache();
|
||||
\Psalm\Config::getInstance()->setIssueHandler('PossiblyUndefinedVariable', null);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ class PropertyTypeTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
\Psalm\Checker\ClassMethodChecker::clearCache();
|
||||
\Psalm\Checker\FileChecker::clearCache();
|
||||
}
|
||||
|
||||
public function testNewVarInIf()
|
||||
|
@ -21,7 +21,6 @@ class ReturnTypeTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
\Psalm\Checker\ClassMethodChecker::clearCache();
|
||||
\Psalm\Checker\FileChecker::clearCache();
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,6 @@ class ScopeTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
\Psalm\Checker\ClassMethodChecker::clearCache();
|
||||
\Psalm\Checker\FileChecker::clearCache();
|
||||
\Psalm\Config::getInstance()->setIssueHandler('PossiblyUndefinedVariable', null);
|
||||
}
|
||||
|
@ -22,7 +22,6 @@ class TypeTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
\Psalm\Checker\ClassMethodChecker::clearCache();
|
||||
\Psalm\Checker\FileChecker::clearCache();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user