Skip to content

Commit 78787f9

Browse files
committed
Handle null case for $lastInstance
1 parent 17810d5 commit 78787f9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Debug.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public static function createException(
9292
* @var OriginException $exception At this point we know that $exceptionClass inherits from OriginException for sure
9393
*/
9494
$exception = new $exceptionClass(
95-
$shownClass . $lastInstance['type'] . $lastInstance['function'] .
95+
$shownClass . ( $lastInstance['type'] ?? '' ) . ( $lastInstance['function'] ?? '' ) .
9696
'(' . self::sanitizeArguments($lastInstance['args'] ?? []) . ')',
9797
$lastInstance['file'] ?? '',
9898
$lastInstance['line'] ?? 0,

tests/DebugTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function testCreateException()
2626
$this->assertEquals(__FILE__, $e->getFile());
2727
$this->assertEquals(__LINE__-8, $e->getLine());
2828
$this->assertEquals($debugClassPath, $e->getExceptionFile());
29-
$this->assertEquals(95, $e->getExceptionLine());
29+
$this->assertEquals(94, $e->getExceptionLine());
3030
$this->assertEquals('SomeClass->someFunction()', $e->getOriginCall());
3131
}
3232
}

0 commit comments

Comments
 (0)