1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-02 09:37:59 +01:00

remove the remaining dynamic property assignment

This commit is contained in:
orklah 2021-11-29 20:11:58 +01:00
parent 8bc71fcf85
commit 8ca0fc209a
2 changed files with 3 additions and 4 deletions

View File

@ -225,11 +225,10 @@ class SimpleNameResolver extends NodeVisitorAbstract
protected function addNamespacedName(Stmt\Class_ $node): void protected function addNamespacedName(Stmt\Class_ $node): void
{ {
/** @psalm-suppress UndefinedPropertyAssignment */ $node->setAttribute('namespacedName', Name::concat(
$node->namespacedName = Name::concat(
$this->nameContext->getNamespace(), $this->nameContext->getNamespace(),
(string)$node->name (string)$node->name
); ));
} }
protected function resolveAttrGroups(Stmt\Class_ $node): void protected function resolveAttrGroups(Stmt\Class_ $node): void

View File

@ -152,7 +152,7 @@ class CodebaseTest extends TestCase
$storage = $event->getStorage(); $storage = $event->getStorage();
$codebase = $event->getCodebase(); $codebase = $event->getCodebase();
if ($storage->name === 'Psalm\\CurrentTest\\C' && $stmt instanceof Class_) { if ($storage->name === 'Psalm\\CurrentTest\\C' && $stmt instanceof Class_) {
$storage->custom_metadata['fqcn'] = (string)($stmt->namespacedName ?? $stmt->name); $storage->custom_metadata['fqcn'] = (string)($stmt->getAttribute('namespacedName') ?? $stmt->name);
$storage->custom_metadata['extends'] = $stmt->extends instanceof Name $storage->custom_metadata['extends'] = $stmt->extends instanceof Name
? (string)$stmt->extends->getAttribute('resolvedName') ? (string)$stmt->extends->getAttribute('resolvedName')
: ''; : '';