8000 bug #36069 [DI] skip untyped properties in AutowireRequiredProperties… · symfony/symfony@0fb0371 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0fb0371

Browse files
committed
bug #36069 [DI] skip untyped properties in AutowireRequiredPropertiesPass (nicolas-grekas)
This PR was merged into the 5.1-dev branch. Discussion ---------- [DI] skip untyped properties in AutowireRequiredPropertiesPass | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Commits ------- 048d092 [DI] skip untyped properties in AutowireRequiredPropertiesPass
2 parents 693cf11 + 048d092 commit 0fb0371

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/Symfony/Component/DependencyInjection/Compiler/AutowireRequiredPropertiesPass.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ protected function processValue($value, bool $isRoot = false)
4242

4343
$properties = $value->getProperties();
4444
foreach ($reflectionClass->getProperties() as $reflectionProperty) {
45+
if (!$reflectionProperty->hasType()) {
46+
continue;
47+
}
4548
if (false === $doc = $reflectionProperty->getDocComment()) {
4649
continue;
4750
}

src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/autowiring_classes_74.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ class PropertiesInjection
99
*/
1010
public Bar $plop;
1111

12+
/**
13+
* @required
14+
*/
15+
public $plip;
16+
1217
public function __construct(A $a)
1318
{
1419
}

0 commit comments

Comments
 (0)
0