Skip to content

Commit

Permalink
Ensure the 'file' parameter exists in individual traces
Browse files Browse the repository at this point in the history
  • Loading branch information
GwendolenLynch committed Mar 2, 2017
1 parent c3d01d1 commit 637860b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Configuration/ResourceManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ public function __construct(\ArrayAccess $container)
{
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
foreach ($trace as $frame) {
// The debug backtrace shows filename and lineno of calling script. In case function is called from inside
// internal function (may be as callback) no filename and lineno may be set. — dmitry@php.net
$frame += ['file' => null];
if (in_array($frame['file'], [__DIR__ . '/ForwardToPathResolver.php', __DIR__ . '/ResourceManager.php', __DIR__ . '/Standard.php', __DIR__ . '/Composer.php'])) {
continue;
}
Expand Down

0 comments on commit 637860b

Please sign in to comment.