File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -573,6 +573,13 @@ attribute like this::
573573 }
574574 }
575575
576+ .. note ::
577+
578+ Some IDEs will show an error when using ``#[Target] `` as in the previous example:
579+ *"Attribute cannot be applied to a property because it does not contain the 'Attribute::TARGET_PROPERTY' flag" *.
580+ The reason is that thanks to `PHP constructor promotion `_ this constructor
581+ argument is both a parameter and a class property. You can safely ignore this error message.
582+
576583.. _autowire-attribute :
577584
578585Fixing Non-Autowireable Arguments
@@ -833,3 +840,4 @@ over all code.
833840
834841.. _ROT13 : https://en.wikipedia.org/wiki/ROT13
835842.. _service definition prototype : https://symfony.com/blog/new-in-symfony-3-3-psr-4-based-service-discovery
843+ .. _`PHP constructor promotion` : https://www.php.net/manual/en/language.oop5.decon.php#language.oop5.decon.constructor.promotion
Original file line number Diff line number Diff line change @@ -699,6 +699,14 @@ directly via PHP attributes:
699699 ;
700700 };
701701
702+ .. note ::
703+
704+ Some IDEs will show an error when using ``#[TaggedIterator] `` together
705+ with the `PHP constructor promotion `_:
706+ *"Attribute cannot be applied to a property because it does not contain the 'Attribute::TARGET_PROPERTY' flag" *.
707+ The reason is that those constructor arguments are both parameters and class
708+ properties. You can safely ignore this error message.
709+
702710If for some reason you need to exclude one or more services when using a tagged
703711iterator, add the ``exclude `` option:
704712
@@ -1162,3 +1170,5 @@ be used directly on the class of the service you want to configure::
11621170 {
11631171 // ...
11641172 }
1173+
1174+ .. _`PHP constructor promotion` : https://www.php.net/manual/en/language.oop5.decon.php#language.oop5.decon.constructor.promotion
You can’t perform that action at this time.
0 commit comments