1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Fix issue reconciling class strings

This commit is contained in:
Matt Brown 2018-08-23 11:43:53 -04:00
parent 867ebd4441
commit 0691763803
3 changed files with 1532 additions and 184 deletions

File diff suppressed because it is too large Load Diff

View File

@ -16,6 +16,14 @@ class TLiteralClassString extends TLiteralString
return 'class-string';
}
/**
* @return string
*/
public function getKey()
{
return 'class-string(' . $this->value . ')';
}
/**
* @param string|null $namespace
* @param array<string> $aliased_classes

View File

@ -246,6 +246,20 @@ class ClassStringTest extends TestCase
bar($class);
}',
],
'arrayEquivalence' => [
'<?php
class A {}
class B {}
$foo = [
A::class,
B::class
];
foreach ($foo as $class) {
if ($class === A::class) {}
}',
],
];
}