From 6283553d197ae26b1d2ee9803621d5cd64e28f02 Mon Sep 17 00:00:00 2001 From: Matthew Brown Date: Thu, 20 Oct 2016 18:16:17 -0400 Subject: [PATCH] Properly clear cache --- src/Psalm/Checker/FileChecker.php | 1 + src/Psalm/Checker/StatementsChecker.php | 13 +++++++++++++ tests/Php70Test.php | 1 - 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Psalm/Checker/FileChecker.php b/src/Psalm/Checker/FileChecker.php index 7fd9f143e..b937eea04 100644 --- a/src/Psalm/Checker/FileChecker.php +++ b/src/Psalm/Checker/FileChecker.php @@ -639,5 +639,6 @@ class FileChecker implements StatementsSource ClassLikeChecker::clearCache(); FunctionChecker::clearCache(); + StatementsChecker::clearCache(); } } diff --git a/src/Psalm/Checker/StatementsChecker.php b/src/Psalm/Checker/StatementsChecker.php index 6f154f8b9..a9a61eb3e 100644 --- a/src/Psalm/Checker/StatementsChecker.php +++ b/src/Psalm/Checker/StatementsChecker.php @@ -5330,4 +5330,17 @@ class StatementsChecker { return isset($this->phantom_classes[$class_name]); } + + public static function clearCache() + { + self::$method_call_index = []; + self::$reflection_functions = []; + + self::$this_assignments = []; + self::$this_calls = []; + + self::$mock_interfaces = []; + + self::$user_constants = []; + } } diff --git a/tests/Php70Test.php b/tests/Php70Test.php index de1a47ef4..accf32b14 100644 --- a/tests/Php70Test.php +++ b/tests/Php70Test.php @@ -101,7 +101,6 @@ class Php70Test extends PHPUnit_Framework_TestCase public function testDefineArray() { - $this->markTestIncomplete('Not yet supported'); $stmts = self::$_parser->parse('