mirror of
https://github.com/danog/psalm.git
synced 2025-01-22 05:41:20 +01:00
Fix some templating issues in CoreGenericClasses
This commit is contained in:
parent
9027bc6190
commit
c65540a323
@ -352,7 +352,7 @@ class ArrayObject implements IteratorAggregate, ArrayAccess, Serializable, Count
|
||||
/**
|
||||
* Sort the entries with a user-defined comparison function and maintain key association
|
||||
* @link http://php.net/manual/en/arrayobject.uasort.php
|
||||
* @param callback $cmp_function <p>
|
||||
* @param callable $cmp_function <p>
|
||||
* Function <i>cmp_function</i> should accept two
|
||||
* parameters which will be filled by pairs of entries.
|
||||
* The comparison function must return an integer less than, equal
|
||||
@ -367,8 +367,8 @@ class ArrayObject implements IteratorAggregate, ArrayAccess, Serializable, Count
|
||||
/**
|
||||
* Sort the entries by keys using a user-defined comparison function
|
||||
* @link http://php.net/manual/en/arrayobject.uksort.php
|
||||
* @param callback $cmp_function <p>
|
||||
* The callback comparison function.
|
||||
* @param callable $cmp_function <p>
|
||||
* The callable comparison function.
|
||||
* </p>
|
||||
* <p>
|
||||
* Function <i>cmp_function</i> should accept two
|
||||
|
@ -1197,7 +1197,11 @@ class ReflectorVisitor extends PhpParser\NodeVisitorAbstract implements PhpParse
|
||||
try {
|
||||
$pseudo_property_type = Type::parseTokens($pseudo_property_type_tokens);
|
||||
$pseudo_property_type->setFromDocblock();
|
||||
$pseudo_property_type->queueClassLikesForScanning($this->codebase, $this->file_storage);
|
||||
$pseudo_property_type->queueClassLikesForScanning(
|
||||
$this->codebase,
|
||||
$this->file_storage,
|
||||
$storage->template_types ?: []
|
||||
);
|
||||
|
||||
if ($property['tag'] !== 'property-read') {
|
||||
$storage->pseudo_property_set_types[$property['name']] = $pseudo_property_type;
|
||||
|
@ -437,7 +437,7 @@ abstract class Atomic
|
||||
array $phantom_classes = []
|
||||
) {
|
||||
if ($this instanceof TNamedObject) {
|
||||
if (!isset($phantom_classes[strtolower($this->value)])) {
|
||||
if (!isset($phantom_classes[$this->value]) && !isset($phantom_classes[strtolower($this->value)])) {
|
||||
$codebase->scanner->queueClassLikeForScanning(
|
||||
$this->value,
|
||||
$file_storage ? $file_storage->file_path : null,
|
||||
@ -479,14 +479,16 @@ abstract class Atomic
|
||||
}
|
||||
|
||||
if ($this instanceof TClassString && $this->as !== 'object') {
|
||||
$codebase->scanner->queueClassLikeForScanning(
|
||||
$this->as,
|
||||
$file_storage ? $file_storage->file_path : null,
|
||||
false,
|
||||
!$this->from_docblock
|
||||
);
|
||||
if ($file_storage) {
|
||||
$file_storage->referenced_classlikes[strtolower($this->as)] = $this->as;
|
||||
if (!isset($phantom_classes[$this->as]) && !isset($phantom_classes[strtolower($this->as)])) {
|
||||
$codebase->scanner->queueClassLikeForScanning(
|
||||
$this->as,
|
||||
$file_storage ? $file_storage->file_path : null,
|
||||
false,
|
||||
!$this->from_docblock
|
||||
);
|
||||
if ($file_storage) {
|
||||
$file_storage->referenced_classlikes[strtolower($this->as)] = $this->as;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,6 @@ class SuicidalAutoloaderTest extends TestCase
|
||||
|
||||
public function testSucceedsWithEmptyFile(): void
|
||||
{
|
||||
$this->runPsalm([], __DIR__ . '/' . '../fixtures/SuicidalAutoloader/');
|
||||
$this->runPsalm(['--no-cache'], __DIR__ . '/' . '../fixtures/SuicidalAutoloader/');
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user