File tree 2 files changed +18
-0
lines changed
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -573,6 +573,13 @@ attribute like this::
573
573
}
574
574
}
575
575
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
+
576
583
.. _autowire-attribute :
577
584
578
585
Fixing Non-Autowireable Arguments
@@ -833,3 +840,4 @@ over all code.
833
840
834
841
.. _ROT13 : https://en.wikipedia.org/wiki/ROT13
835
842
.. _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:
699
699
;
700
700
};
701
701
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
+
702
710
If for some reason you need to exclude one or more services when using a tagged
703
711
iterator, add the ``exclude `` option:
704
712
@@ -1162,3 +1170,5 @@ be used directly on the class of the service you want to configure::
1162
1170
{
1163
1171
// ...
1164
1172
}
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