mirror of
https://github.com/danog/psalm.git
synced 2024-11-26 20:34:47 +01:00
commit
c67dce7d14
@ -115,7 +115,11 @@ class FileStatementsDiffer extends AstDiffer
|
||||
$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]];
|
||||
|
@ -199,5 +199,54 @@ class CacheTest extends TestCase
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
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",
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user