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

Validating #[Attribute] classes #4609

Closed
3 tasks
ondrejmirtes opened this issue Nov 18, 2020 · 3 comments
Closed
3 tasks

Validating #[Attribute] classes #4609

ondrejmirtes opened this issue Nov 18, 2020 · 3 comments

Comments

@ondrejmirtes
Copy link

  • When ClassLike has #[Attribute], it cannot be an interface nor a trait
  • When Class_ has #[Attribute], it cannot be abstract
  • When Class_ has #[Attribute], it cannot have a non-public constructor
@psalm-github-bot
Copy link

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

@ondrejmirtes
Copy link
Author

These should report errors: https://psalm.dev/r/f59429d510

@psalm-github-bot
Copy link

I found these snippets:

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

#[Attribute]
interface Foo
{
}

#[Atribute]
trait Bar
{
}

#[Attribute]
abstract class Baz
{
}
Psalm output (using commit be275ae):

No issues!

@muglug muglug closed this as completed in 60b3086 Nov 22, 2020
danog pushed a commit to danog/psalm that referenced this issue Jan 29, 2021
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

No branches or pull requests

1 participant