1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

Properly clear cache

This commit is contained in:
Matthew Brown 2016-10-20 18:16:17 -04:00
parent 0100ca2b8c
commit 6283553d19
3 changed files with 14 additions and 1 deletions

View File

@ -639,5 +639,6 @@ class FileChecker implements StatementsSource
ClassLikeChecker::clearCache(); ClassLikeChecker::clearCache();
FunctionChecker::clearCache(); FunctionChecker::clearCache();
StatementsChecker::clearCache();
} }
} }

View File

@ -5330,4 +5330,17 @@ class StatementsChecker
{ {
return isset($this->phantom_classes[$class_name]); 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 = [];
}
} }

View File

@ -101,7 +101,6 @@ class Php70Test extends PHPUnit_Framework_TestCase
public function testDefineArray() public function testDefineArray()
{ {
$this->markTestIncomplete('Not yet supported');
$stmts = self::$_parser->parse('<?php $stmts = self::$_parser->parse('<?php
define("ANIMALS", [ define("ANIMALS", [
"dog", "dog",