Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf22ebf9

Browse files
committed
More bullet-proof expression evaluation
In some scenarios evaluating expression can lead to TypeError (unresolved DI params being strings, not expected integers etc).
1 parent1a7bf06 commitf22ebf9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/Symfony/Component/DependencyInjection/Compiler/CheckTypeDeclarationsPass.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ private function checkType(Definition $checkedDefinition, mixed $value, \Reflect
228228
}elseif ($valueinstanceof Expression) {
229229
try {
230230
$value =$this->getExpressionLanguage()->evaluate($value, ['container' =>$this->container]);
231-
}catch (\Exception) {
231+
}catch (\Throwable$e) {
232232
// If a service from the expression cannot be fetched from the container, we skip the validation.
233233
return;
234234
}
@@ -243,7 +243,7 @@ private function checkType(Definition $checkedDefinition, mixed $value, \Reflect
243243
if ('' ===preg_replace('/'.$envPlaceholderUniquePrefix.'_\w+_[a-f0-9]{32}/U','',$value, -1,$c) &&1 ===$c) {
244244
try {
245245
$value =$this->container->resolveEnvPlaceholders($value,true);
246-
}catch (\Exception) {
246+
}catch (\Throwable) {
247247
// If an env placeholder cannot be resolved, we skip the validation.
248248
return;
249249
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp