Structural Search: finding php attributes

I'm trying to use Structural Search to find classes that have one attribute but don't implement some interface or have another attribute.

For example, having this code:

```
#[\Doctrine\ORM\Mapping\Entity( )]
class SomeEntity
{
}
```

I want to add an inspection that highlights this class unless the class implements `MyInterface` or has another Attribute IgnoreMyInterface (i.e. `#[IgnoreMyInterface]`, which I use to mark exceptions to the rule for my git pre-commit hook).

How do I search for “class has the Entity attribute”?

0
1 comment

Hi,

Looks like, SSR does not play well with attributes. I have tried several approaches but without any luck, sadly.
Here is a fresh new request to introduce a better support of attributes in SSR:
https://youtrack.jetbrains.com/issue/WI-76063/SSR-Support-PHP-attributes

 

0

Please sign in to leave a comment.