mirror of
https://github.com/php/doc-en.git
synced 2026-03-24 07:42:10 +01:00
Add list of attribute target constants
I think the constant names are self-explanatory enough to not require additional information Closes GH-1168.
This commit is contained in:
@@ -333,6 +333,18 @@ class MyAttribute
|
||||
</para>
|
||||
</example>
|
||||
|
||||
<para>The following targets can be specified:</para>
|
||||
|
||||
<simplelist>
|
||||
<member><constant>Attribute::TARGET_CLASS</constant></member>
|
||||
<member><constant>Attribute::TARGET_FUNCTION</constant></member>
|
||||
<member><constant>Attribute::TARGET_METHOD</constant></member>
|
||||
<member><constant>Attribute::TARGET_PROPERTY</constant></member>
|
||||
<member><constant>Attribute::TARGET_CLASS_CONSTANT</constant></member>
|
||||
<member><constant>Attribute::TARGET_PARAMETER</constant></member>
|
||||
<member><constant>Attribute::TARGET_ALL</constant></member>
|
||||
</simplelist>
|
||||
|
||||
<para>
|
||||
By default an attribute can only be used once per declaration. If the attribute should be repeatable on declarations it must
|
||||
be specified as part of the bitmask to the <literal>#[Attribute]</literal> declaration.
|
||||
|
||||
Reference in New Issue
Block a user