Skip to content

Conversation

@samsonasik
Copy link
Member

Given the following code:

use PhpParser\Node\Stmt\Class_;

final class SkipClassNameString
{
    public function run(): array
    {
        return [
            Class_::class,
        ];
    }
}

It got:

+    /**
+     * @return \PhpParser\Node\Stmt\ClassLike[]
+     */
    public function run(): array
    {
        return [
            Class_::class,
        ];
    }

which invalid, as returns are strings, while it docblock are objects of ClassLike.

@samsonasik
Copy link
Member Author

Fixed 🎉 /cc @TomasVotruba

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it ;)

@samsonasik samsonasik enabled auto-merge (squash) September 12, 2025 11:42
@samsonasik samsonasik disabled auto-merge September 12, 2025 11:42
@samsonasik
Copy link
Member Author

I think common ! isObject()->yes() can work, see 52ed0cc

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it ;)

@samsonasik samsonasik enabled auto-merge (squash) September 12, 2025 11:44
@samsonasik samsonasik merged commit 7c6393a into main Sep 12, 2025
49 checks passed
@samsonasik samsonasik deleted the skip-class-name-string branch September 12, 2025 11:45
@TomasVotruba
Copy link
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants