From 5bc0becac87d34de4ec073f01bacc6a42cb08fc4 Mon Sep 17 00:00:00 2001 From: Alexandre Daubois Date: Tue, 4 Apr 2023 18:59:58 +0200 Subject: [PATCH] [PropertyInfo] Add `ConstructorExtractor` documentation for 6.2 (with CPP) --- components/property_info.rst | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/components/property_info.rst b/components/property_info.rst index bb3123b4dc9..84315f59f70 100644 --- a/components/property_info.rst +++ b/components/property_info.rst @@ -438,6 +438,7 @@ information from annotations of properties and methods, such as ``@var``, // Extraction.php use Symfony\Component\PropertyInfo\Extractor\PhpStanExtractor; + use App\Domain\Foo; $phpStanExtractor = new PhpStanExtractor(); $phpStanExtractor->getTypesFromConstructor(Foo::class, 'bar'); @@ -517,11 +518,9 @@ on the constructor arguments:: // src/Domain/Foo.php class Foo { - private $bar; - - public function __construct(string $bar) - { - $this->bar = $bar; + public function __construct( + private string $bar, + ) { } }