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

InvalidAttribute for #[\Override] in PHP 8.3 #10404

Closed
Tracked by #254
vudaltsov opened this issue Nov 23, 2023 · 5 comments · Fixed by #10493
Closed
Tracked by #254

InvalidAttribute for #[\Override] in PHP 8.3 #10404

vudaltsov opened this issue Nov 23, 2023 · 5 comments · Fixed by #10493

Comments

@vudaltsov
Copy link
Contributor

ERROR: InvalidAttribute
at xxx.php:33:7
The class Override doesn't have the Attribute attribute (see https://psalm.dev/242)
    #[\Override]
Copy link

Hey @vudaltsov, can you reproduce the issue on https://psalm.dev ?

@delolmo
Copy link
Contributor

delolmo commented Nov 24, 2023

Only way I can reproduce is with the following snippet, but psalm.dev does not recognize Override as a class overall.

https://psalm.dev/r/e9a17b8541

Copy link

I found these snippets:

https://psalm.dev/r/e9a17b8541
<?php

use Override;

interface Example
{
    public function __invoke(string $name): string;
}

class Child implements Example
{
    #[Override]
    public function __invoke(string $name): string
    {
        return $name;
    }
}
Psalm output (using commit baa6d5d):

INFO: UndefinedAttributeClass - 12:7 - Attribute class Override does not exist

@ciltocruz
Copy link

any news?

@delolmo
Copy link
Contributor

delolmo commented Dec 15, 2023

I created the PR and it is in a passing state. Should be a matter of time.

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 a pull request may close this issue.

3 participants