Skip to content

Commit 0ae92e1

Browse files
committed
fix
1 parent 344ccc5 commit 0ae92e1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/ErrorHandler.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ public function register(): void
141141
unset($backtrace[0]['function'], $backtrace[0]['class'], $backtrace[0]['type'], $backtrace[0]['args']);
142142
} else {
143143
array_shift($backtrace);
144+
array_shift($backtrace);
144145
}
145146

146147
throw new ErrorException($message, $severity, $severity, $file, $line, null, $backtrace);

tests/ErrorHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ public function testHandleTriggerErrorWithCatching(): void
138138

139139
$backtrace = $exception->getBacktrace();
140140
$this->assertNotEmpty($backtrace);
141-
$this->assertArrayHasKey('file', $backtrace[0]);
142-
$this->assertSame(__FILE__, $backtrace[0]['file']);
141+
$this->assertArrayHasKey('class', $backtrace[0]);
142+
$this->assertSame(self::class, $backtrace[0]['class']);
143143

144144
$this->errorHandler->unregister();
145145
}

0 commit comments

Comments
 (0)