Skip to content

Commit

Permalink
bug #34695 [Config] don't break on virtual stack frames in ClassExist…
Browse files Browse the repository at this point in the history
…enceResource (nicolas-grekas)

This PR was merged into the 3.4 branch.

Discussion
----------

[Config] don't break on virtual stack frames in ClassExistenceResource

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34665
| License       | MIT
| Doc PR        | -

Commits
-------

fffeccd [Config] don't break on virtual stack frames in ClassExistenceResource
  • Loading branch information
nicolas-grekas committed Nov 29, 2019
2 parents e085173 + fffeccd commit 2d2dd62
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 2d2dd62

Please sign in to comment.