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

Commit247f0f9

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

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
@@ -231,7 +231,7 @@ private function checkType(Definition $checkedDefinition, mixed $value, \Reflect
231231
}elseif ($valueinstanceof Expression) {
232232
try {
233233
$value =$this->getExpressionLanguage()->evaluate($value, ['container' =>$this->container]);
234-
}catch (\Exception) {
234+
}catch (\Throwable) {
235235
// If a service from the expression cannot be fetched from the container, we skip the validation.
236236
return;
237237
}
@@ -246,7 +246,7 @@ private function checkType(Definition $checkedDefinition, mixed $value, \Reflect
246246
if ('' ===preg_replace('/'.$envPlaceholderUniquePrefix.'_\w+_[a-f0-9]{32}/U','',$value, -1,$c) &&1 ===$c) {
247247
try {
248248
$value =$this->container->resolveEnvPlaceholders($value,true);
249-
}catch (\Exception) {
249+
}catch (\Throwable) {
250250
// If an env placeholder cannot be resolved, we skip the validation.
251251
return;
252252
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp