Skip to content

Commit

Permalink
Merge pull request #7022 from orklah/7007
Browse files Browse the repository at this point in the history
remove the remaining dynamic property assignment
  • Loading branch information
orklah committed Nov 30, 2021
2 parents 466137a + 8ca0fc2 commit 2c6ea7c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/Psalm/Internal/PhpVisitor/SimpleNameResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,10 @@ protected function resolveClassName(Name $name): Name

protected function addNamespacedName(Stmt\Class_ $node): void
{
/** @psalm-suppress UndefinedPropertyAssignment */
$node->namespacedName = Name::concat(
$node->setAttribute('namespacedName', Name::concat(
$this->nameContext->getNamespace(),
(string)$node->name
);
));
}

protected function resolveAttrGroups(Stmt\Class_ $node): void
Expand Down
2 changes: 1 addition & 1 deletion tests/CodebaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public static function afterClassLikeVisit(AfterClassLikeVisitEvent $event)
$storage = $event->getStorage();
$codebase = $event->getCodebase();
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
? (string)$stmt->extends->getAttribute('resolvedName')
: '';
Expand Down

0 comments on commit 2c6ea7c

Please sign in to comment.