Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phpstan-param Class::CONST_* throws exceptions #39

Open
frankdekker opened this issue Jun 25, 2022 · 1 comment
Open

phpstan-param Class::CONST_* throws exceptions #39

frankdekker opened this issue Jun 25, 2022 · 1 comment

Comments

@frankdekker
Copy link
Member

class Example
{
    public const TYPE_A = 'a';
    public const TYPE_B = 'b';

    /**
     * @phpstan-param Example::TYPE_* $type
     */
    public function __construct(private string $type)
    {
    }

    public function getType(): string {
        return $this->type;
    }
}

Throws error message:
Unable to run constraint on class. "\Example::TYPE_*" is not a valid Fqsen.

@frankdekker frankdekker changed the title phpstan-var Class::CONST_* throws exceptions phpstan-param Class::CONST_* throws exceptions Jun 25, 2022
@bram123
Copy link
Member

bram123 commented Jul 3, 2022

Yes that syntax is not supported at the moment.
Using https://github.com/phpDocumentor/TypeResolver to check the phpdoc, and that package doesn't have too much support for the phpstan/psalm syntax.

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

No branches or pull requests

2 participants