1
0
mirror of https://github.com/php/doc-en.git synced 2026-03-24 15:52:15 +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:
Eric Stern
2021-12-02 14:01:16 -08:00
committed by GitHub
parent 766f190db3
commit 93cc19efef

View File

@@ -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.