Skip to content

Commit

Permalink
Merge pull request #10240 from ging-dev/cache
Browse files Browse the repository at this point in the history
fix: #10239
  • Loading branch information
orklah authored Sep 30, 2023
2 parents db07b05 + c312c76 commit c67dce7
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Psalm/Internal/Diff/FileStatementsDiffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ static function (
$b_code,
);

$keep = [...$keep, ...$class_keep[0]];
if ($diff_elem->old->getDocComment() === $diff_elem->new->getDocComment()) {
$keep = [...$keep, ...$class_keep[0]];
} else {
$keep_signature = [...$keep_signature, ...$class_keep[0]];
}
$keep_signature = [...$keep_signature, ...$class_keep[1]];
$add_or_delete = [...$add_or_delete, ...$class_keep[2]];
$diff_map = [...$diff_map, ...$class_keep[3]];
Expand Down
49 changes: 49 additions & 0 deletions tests/Cache/CacheTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,54 @@ class B {
],
],
];

yield 'classDocblockChange' => [
[
[
'files' => [
'/src/A.php' => <<<'PHP'
<?php
/**
* @template T
*/
class A {
/**
* @param T $baz
*/
public function foo($baz): void
{
}
}
PHP,
],
'issues' => [],
],
[
'files' => [
'/src/A.php' => <<<'PHP'
<?php
/**
* @template K
*/
class A {
/**
* @param T $baz
*/
public function foo($baz): void
{
}
}
PHP,
],
'issues' => [
'/src/A.php' => [
"UndefinedDocblockClass: Docblock-defined class, interface or enum named T does not exist",
],
],
],
],
];
}
}

0 comments on commit c67dce7

Please sign in to comment.