Skip to content

Commit

Permalink
Scan on 8.0+, fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Feb 8, 2022
1 parent 5b76139 commit 6852146
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Psalm/Internal/Codebase/Reflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ public function extractReflectionMethodInfo(ReflectionMethod $method): void
$storage->setParams($callables[0]->params);

$storage->return_type = $callables[0]->return_type;
if ($this->codebase->analysis_php_version_id >= 80100) {
if ($this->codebase->analysis_php_version_id >= 80000) {
$storage->signature_return_type = $storage->return_type;
}
$storage->return_type->queueClassLikesForScanning($this->codebase);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,7 @@ private static function handleReturn(
}
} elseif ($classlike_storage
&& !$classlike_storage->user_defined
&& $codebase->analysis_php_version_id >= 80100
&& $codebase->analysis_php_version_id >= 80000
&& !$storage->signature_return_type
) {
$new = [];
Expand Down
3 changes: 3 additions & 0 deletions tests/AttributeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ public function getIterator()
use IteratorAggregate;
use ReturnTypeWillChange;
/**
* @psalm-suppress MethodSignatureMismatch
*/
final class EmptyCollection implements IteratorAggregate
{
#[ReturnTypeWillChange]
Expand Down

0 comments on commit 6852146

Please sign in to comment.