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
I don't find any documentation about using Attribute on interfaces
Example:
<?php
#[\Attribute]
finalreadonlyclass TestAttribute
{}
#[TestAttribute]
interface TestInterface {}
finalreadonly Test implements TestInterface {}
// If i try get class attribute with reflection$t = newTest;
$r = new \ReflectionClass($t);
echocount($r->getAttributes()); // Display 0
And its valid using or not?
The text was updated successfully, but these errors were encountered:
Attributes are not inherited, so if you define TestAttribute on the interface then you must call getAttributes on that interface directly. You can, of course, use methods like getParentClass and getInterfaces to "discover" all attributes of a class. https://3v4l.org/A1a7q
I do not see this mentioned in the documentation. Do you have a suggestion on how to add it?
I don't find any documentation about using Attribute on interfaces
Example:
And its valid using or not?
The text was updated successfully, but these errors were encountered: