Skip to content
Permalink
Browse files

Fix #1973 - bust method mutation cache when reloading language server

  • Loading branch information...
muglug committed Jul 28, 2019
1 parent 8cb5d01 commit 2f400381a5f86d7319c2802f2f248bffd7aae1ff
Showing with 64 additions and 0 deletions.
  1. +2 −0 src/Psalm/Codebase.php
  2. +62 −0 tests/FileUpdates/TemporaryUpdateTest.php
@@ -356,6 +356,8 @@ public function reloadFiles(ProjectAnalyzer $project_analyzer, array $candidate_
$this->file_reference_provider->loadReferenceCache(false);
Internal\Analyzer\FunctionLikeAnalyzer::clearCache();
if (!$this->statements_provider->parser_cache_provider) {
$diff_files = $candidate_files;
} else {
@@ -1251,6 +1251,68 @@ public function __construct() {}
],
'error_positions' => [[230], [230]],
],
'updatePropertyInitialization' => [
[
[
getcwd() . DIRECTORY_SEPARATOR . 'A.php' => '<?php
class B {
/**
* @var string
*/
public $foo;
/**
* @var int
*/
public $bar;
public function __construct(string $foo, int $bar) {
$this->foo = $foo;
$this->bar = $bar;
}
}',
],
[
getcwd() . DIRECTORY_SEPARATOR . 'A.php' => '<?php
class B {
/**
* @var string
*/
public $foo;
/**
* @var int
*/
public $bar;
public function __construct(string $foo, int $bar) {
// $this->foo = $foo;
$this->bar = $bar;
}
}',
],
[
getcwd() . DIRECTORY_SEPARATOR . 'A.php' => '<?php
class B {
/**
* @var string
*/
public $foo;
/**
* @var int
*/
public $bar;
public function __construct(string $foo, int $bar) {
$this->foo = $foo;
$this->bar = $bar;
}
}',
],
],
'error_positions' => [[], [202], []],
],
'addPartialMethodWithSyntaxError' => [
[
[

0 comments on commit 2f40038

Please sign in to comment.
You can’t perform that action at this time.