Skip to content

Commit

Permalink
[Config] don't break on virtual stack frames in ClassExistenceResource
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Nov 28, 2019
1 parent fa783f9 commit fffeccd
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Symfony/Component/Config/Resource/ClassExistenceResource.php
Expand Up @@ -191,15 +191,17 @@ public static function throwOnRequiredClass($class, \Exception $previous = null)
}

$props = [
'file' => $trace[$i]['file'],
'line' => $trace[$i]['line'],
'file' => isset($trace[$i]['file']) ? $trace[$i]['file'] : null,
'line' => isset($trace[$i]['line']) ? $trace[$i]['line'] : null,
'trace' => \array_slice($trace, 1 + $i),
];

foreach ($props as $p => $v) {
$r = new \ReflectionProperty('Exception', $p);
$r->setAccessible(true);
$r->setValue($e, $v);
if (null !== $v) {
$r = new \ReflectionProperty('Exception', $p);
$r->setAccessible(true);
$r->setValue($e, $v);
}
}
}

Expand Down

0 comments on commit fffeccd

Please sign in to comment.