mirror of
https://github.com/danog/psalm.git
synced 2025-01-21 21:31:13 +01:00
Scan shape properties (#2359)
This prevents crashes when built-in classes are referenced by shape properties. Fixes vimeo/psalm#2331
This commit is contained in:
parent
81f513bb4c
commit
c50a17d415
@ -546,6 +546,16 @@ abstract class Atomic
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ($this instanceof ObjectLike) {
|
||||
foreach ($this->properties as $property) {
|
||||
$property->queueClassLikesForScanning(
|
||||
$codebase,
|
||||
$file_storage,
|
||||
$phantom_classes
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function containsClassLike(string $fq_classlike_name) : bool
|
||||
|
@ -563,6 +563,15 @@ class AnnotationTest extends TestCase
|
||||
*/
|
||||
class A {}',
|
||||
],
|
||||
'builtInClassInAShape' => [
|
||||
'<?php
|
||||
/**
|
||||
* @return array{d:Exception}
|
||||
* @psalm-suppress InvalidReturnType
|
||||
*/
|
||||
function f() {}
|
||||
'
|
||||
],
|
||||
'slashAfter?' => [
|
||||
'<?php
|
||||
namespace ns;
|
||||
|
Loading…
x
Reference in New Issue
Block a user