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
-------

048d09213e [DI] skip untyped properties in AutowireRequiredPropertiesPass
This commit is contained in:
Fabien Potencier 2020-03-16 07:13:08 +01:00
commit 0fb0371029
2 changed files with 8 additions and 0 deletions

View File

@ -42,6 +42,9 @@ class AutowireRequiredPropertiesPass extends AbstractRecursivePass
$properties = $value->getProperties();
foreach ($reflectionClass->getProperties() as $reflectionProperty) {
if (!$reflectionProperty->hasType()) {
continue;
}
if (false === $doc = $reflectionProperty->getDocComment()) {
continue;
}

View File

@ -9,6 +9,11 @@ class PropertiesInjection
*/
public Bar $plop;
/**
* @required
*/
public $plip;
public function __construct(A $a)
{
}