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 @@ -582,6 +582,13 @@ attribute like this::
582
582
}
583
583
}
584
584
585
+ .. note ::
586
+
587
+ Some IDEs will show an error when using the ``#[Target] `` as in the previous example:
588
+ *"Attribute cannot be applied to a property because it does not contain the 'Attribute::TARGET_PROPERTY' flag" *.
589
+ The reason is that thanks to `PHP constructor promotion `_ this constructor
590
+ argument is both a parameter and a class property. You can safely ignore this error message.
591
+
585
592
.. versionadded :: 5.3
586
593
587
594
The ``#[Target] `` attribute was introduced in Symfony 5.3.
@@ -737,3 +744,4 @@ over all code.
737
744
738
745
.. _ROT13 : https://en.wikipedia.org/wiki/ROT13
739
746
.. _service definition prototype : https://symfony.com/blog/new-in-symfony-3-3-psr-4-based-service-discovery
747
+ .. _`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 @@ -717,6 +717,14 @@ directly via PHP attributes:
717
717
;
718
718
};
719
719
720
+ .. note ::
721
+
722
+ Some IDEs will show an error when using the ``#[TaggedIterator] `` together
723
+ with the `PHP constructor promotion `_:
724
+ *"Attribute cannot be applied to a property because it does not contain the 'Attribute::TARGET_PROPERTY' flag" *.
725
+ The reason is that those constructor arguments are both parameters and class
726
+ properties. You can safely ignore this error message.
727
+
720
728
.. versionadded :: 5.3
721
729
722
730
The ``#[TaggedIterator] `` attribute was introduced in Symfony 5.3 and requires PHP 8.
@@ -1092,3 +1100,5 @@ be used directly on the class of the service you want to configure::
1092
1100
.. versionadded :: 5.3
1093
1101
1094
1102
The ``#[AsTaggedItem] `` attribute was introduced in Symfony 5.3.
1103
+
1104
+ .. _`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