Skip to content

Commit

Permalink
Check if serializeable closure is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenvanassche committed Apr 24, 2024
1 parent 3b82c37 commit 8373b9d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
}
],
"require": {
"php": "^7.3|^8.0",
"laravel/serializable-closure": "^1.3"
"php": "^7.3|^8.0"
},
"require-dev": {
"ext-json": "*",
"phpunit/phpunit": "^9.3",
"laravel/serializable-closure": "^1.3",
"spatie/phpunit-snapshot-assertions": "^4.2",
"symfony/var-dumper": "^5.1"
},
Expand Down
5 changes: 4 additions & 1 deletion src/Backtrace.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@ protected function toFrameObjects(array $rawFrames): array
foreach ($rawFrames as $rawFrame) {
$textSnippet = null;

if (substr($currentFile, 0, strlen(ClosureStream::STREAM_PROTO)) === ClosureStream::STREAM_PROTO) {
if (
class_exists(ClosureStream::class)
&& substr($currentFile, 0, strlen(ClosureStream::STREAM_PROTO)) === ClosureStream::STREAM_PROTO
) {
$textSnippet = $currentFile;
$currentFile = ClosureStream::STREAM_PROTO.'://function()';
$currentLine -= 1;
Expand Down

0 comments on commit 8373b9d

Please sign in to comment.