Skip to content

Commit

Permalink
[DI] cascade preloading only to public parameters/properties
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Sep 10, 2019
1 parent 3536b13 commit 0e3ea8f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -67,14 +67,14 @@ private static function doPreload(string $class, array &$preloaded)
$r->getDefaultProperties();

if (\PHP_VERSION_ID >= 70400) {
foreach ($r->getProperties() as $p) {
foreach ($r->getProperties(\ReflectionProperty::IS_PUBLIC) as $p) {
if (($t = $p->getType()) && !$t->isBuiltin()) {
self::doPreload($t->getName(), $preloaded);
}
}
}

foreach ($r->getMethods() as $m) {
foreach ($r->getMethods(\ReflectionMethod::IS_PUBLIC) as $m) {
foreach ($m->getParameters() as $p) {
if ($p->isDefaultValueAvailable() && $p->isDefaultValueConstant()) {
$c = $p->getDefaultValueConstantName();
Expand Down
Expand Up @@ -15,7 +15,7 @@
use Symfony\Component\ExpressionLanguage\ExpressionLanguage as BaseExpressionLanguage;

if (!class_exists(BaseExpressionLanguage::class)) {
throw new \ReflectionException(BaseExpressionLanguage::class.' not found.');
return;
}

/**
Expand Down

0 comments on commit 0e3ea8f

Please sign in to comment.