Skip to content

Commit 1b24306

Browse files
[DI] cascade preloading only to public parameters/properties
1 parent 460aa9f commit 1b24306

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Dumper/Preloader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,14 @@ private static function doPreload(string $class, array &$preloaded)
6767
$r->getDefaultProperties();
6868

6969
if (\PHP_VERSION_ID >= 70400) {
70-
foreach ($r->getProperties() as $p) {
70+
foreach ($r->getProperties(\ReflectionProperty::IS_PUBLIC) as $p) {
7171
if (($t = $p->getType()) && !$t->isBuiltin()) {
7272
self::doPreload($t->getName(), $preloaded);
7373
}
7474
}
7575
}
7676

77-
foreach ($r->getMethods() as $m) {
77+
foreach ($r->getMethods(\ReflectionMethod::IS_PUBLIC) as $m) {
7878
foreach ($m->getParameters() as $p) {
7979
if ($p->isDefaultValueAvailable() && $p->isDefaultValueConstant()) {
8080
$c = $p->getDefaultValueConstantName();

ExpressionLanguage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use Symfony\Component\ExpressionLanguage\ExpressionLanguage as BaseExpressionLanguage;
1616

1717
if (!class_exists(BaseExpressionLanguage::class)) {
18-
throw new \ReflectionException(BaseExpressionLanguage::class.' not found.');
18+
return;
1919
}
2020

2121
/**

0 commit comments

Comments
 (0)