Skip to content

Commit 5bc0bec

Browse files
[PropertyInfo] Add ConstructorExtractor documentation for 6.2 (with CPP)
1 parent bcf07d5 commit 5bc0bec

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

components/property_info.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ information from annotations of properties and methods, such as ``@var``,
438438

439439
// Extraction.php
440440
use Symfony\Component\PropertyInfo\Extractor\PhpStanExtractor;
441+
use App\Domain\Foo;
441442

442443
$phpStanExtractor = new PhpStanExtractor();
443444
$phpStanExtractor->getTypesFromConstructor(Foo::class, 'bar');
@@ -517,11 +518,9 @@ on the constructor arguments::
517518
// src/Domain/Foo.php
518519
class Foo
519520
{
520-
private $bar;
521-
522-
public function __construct(string $bar)
523-
{
524-
$this->bar = $bar;
521+
public function __construct(
522+
private string $bar,
523+
) {
525524
}
526525
}
527526

0 commit comments

Comments
 (0)