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:
parent
867ebd4441
commit
0691763803
File diff suppressed because it is too large
Load Diff
@ -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
|
||||
|
@ -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) {}
|
||||
}',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user