You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This attribute is the equivalent of the `@require-extends` annotation. It can be applied to a trait to specify that the class using it must extend a specific class.
4
+
5
+
## Arguments
6
+
7
+
The attribute accepts one string that defines the class that needs to be extended. The attribute itself does not have a knowledge of which classes are valid and which are not and this will depend on the implementation for each particular tool.
8
+
9
+
We aim to accept all the classes accepted by static analysis tools for the `@require-extends` annotation.
This attribute is the equivalent of the `@require-implements` annotation. It can be applied to a trait to indicate that the class using it should implement one or more interfaces.
4
+
5
+
## Arguments
6
+
7
+
The attribute accepts one or more strings that define the interfaces that need to be implemented. The attribute itself does not have a knowledge of which interfaces are valid and which are not and this will depend on the implementation for each particular tool.
8
+
9
+
We aim to accept all the interface names accepted by static analysis tools for the `@require-implements` annotation.
10
+
11
+
The arguments need to be unnamed arguments.
12
+
13
+
If the class has more than one interface that we want to require, the different interfaces can either be declared as a list of strings for a single `RequireInterface` attribute or as a list of `RequireInterface` attributes (or even a combination of both, though we don't expect this to be actually used).
14
+
15
+
## Example usage
16
+
17
+
```php
18
+
<?php
19
+
20
+
use PhpStaticAnalysis\Attributes\RequireImplements;
0 commit comments