8000 Fixed: `TraceableMessageBus` can now be used in conjunction with call… · symfony/symfony@de2d2c3 · GitHub
[go: up one dir, main page]

Skip to content

Commit de2d2c3

Browse files
committed
Fixed: TraceableMessageBus can now be used in conjunction with callbacks
To be on the safe side, also removed `compact()` usage, which was making everything much muddier and harder to comprehend.
1 parent a894125 commit de2d2c3

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/Symfony/Component/Messenger/TraceableMessageBus.php

+8-5
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ private function getCaller(): array
6262
{
6363
$trace = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 8);
6464

65-
$file = $trace[1]['file'];
66-
$line = $trace[1]['line'];
65+
$file = $trace[1]['file'] ?? null;
66+
$line = $trace[1]['line'] ?? null;
6767

6868
$handleTraitFile = (new \ReflectionClass(HandleTrait::class))->getFileName();
6969
$found = false;
@@ -97,9 +97,12 @@ private function getCaller(): array
9797
}
9898
}
9999

100-
$name = str_replace('\\', '/', $file);
101-
$name = substr($name, strrpos($name, '/') + 1);
100+
$name = str_replace('\\', '/', (string) $file);
102101

103-
return compact('name', 'file', 'line');
102+
return [
103+
'name' => substr($name, strrpos($name, '/') + 1),
104+
'file' => $file,
105+
'line' => $line
106+
];
104107
}
105108
}

0 commit comments

Comments
 (0)
0