Skip to content

Commit c0def49

Browse files
committed
Check if Spatie\Ray is present
1 parent 53b8206 commit c0def49

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/ErrorPayload.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public function toArray(): array
5757

5858
protected function getOrigin(): Origin
5959
{
60+
6061
/** @var \Spatie\Ray\Origin\OriginFactory $originFactory */
6162
$originFactory = new self::$originFactoryClass;
6263

src/Ray.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ public function init($debug = false)
1212

1313
$this->debug = $debug;
1414

15+
if( ! class_exists('Spatie\Ray\Origin\Origin') ) {
16+
return;
17+
}
18+
1519
set_exception_handler([$this, 'setExceptionHandler']); // exception
1620
set_error_handler([$this, 'setErrorHandler']); // error
1721
register_shutdown_function([$this, 'registerShutdownFunction']); // fatal error

0 commit comments

Comments
 (0)