*/ final class PropertyNameResolver implements NodeNameResolverInterface { public function getNode() : string { return Property::class; } /** * @param Property $node */ public function resolve(Node $node, ?Scope $scope) : ?string { if ($node->props === []) { return null; } $onlyProperty = $node->props[0]; return $onlyProperty->name->toString(); } }