From 01456b2c020473b63b86aad0541e102401502aea Mon Sep 17 00:00:00 2001 From: Marian <42134098+IanDelMar@users.noreply.github.com> Date: Tue, 6 Oct 2026 20:07:19 +0200 Subject: [PATCH] Use namespaced symbol names in the visitor --- src/Visitor.php | 7 ++++--- wordpress-stubs.php | 2 -- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Visitor.php b/src/Visitor.php index 4c48b1d..f15fc5a 100644 --- a/src/Visitor.php +++ b/src/Visitor.php @@ -129,16 +129,17 @@ private function getSymbolName(Node $node): string assert(isset($name), 'Node does not have a name'); if ($node instanceof Function_ || $node instanceof ClassLike) { - return $name; + assert($node->namespacedName instanceof Name); + return $node->namespacedName->toString(); } $parent = $this->stack[count($this->stack) - 2]; assert($parent instanceof ClassLike); - assert($parent->name instanceof Identifier); + assert($parent->namespacedName instanceof Name); return sprintf( '%1$s::%2$s%3$s', - $parent->name->name, + $parent->namespacedName->toString(), $node instanceof Property ? '$' : '', $name ); diff --git a/wordpress-stubs.php b/wordpress-stubs.php index 5526ea8..9565127 100644 --- a/wordpress-stubs.php +++ b/wordpress-stubs.php @@ -24127,7 +24127,6 @@ class File implements \SimplePie\Cache\Base * @param string $location Location string (from SimplePie::$cache_location) * @param string $name Unique ID for the cache * @param Base::TYPE_FEED|Base::TYPE_IMAGE $type Either TYPE_FEED for SimplePie data, or TYPE_IMAGE for image data - * @phpstan-return void */ public function __construct(string $location, string $name, $type) { @@ -76318,7 +76317,6 @@ class File extends \WordPress\AiClient\Common\AbstractDataTransferObject * @param string $file The file string (URL, base64 data, or local path). * @param string|null $mimeType The MIME type of the file (optional). * @throws \WordPress\AiClient\Common\Exception\InvalidArgumentException If the file format is invalid or MIME type cannot be determined. - * @phpstan-return void */ public function __construct(string $file, ?string $mimeType = null) {