Skip to content

Commit ad393ae

Browse files
authored
Replace get_class() calls with ::class keyword
1 parent ab7a279 commit ad393ae

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

Slim/Middleware/HtmlExceptionMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private function renderExceptionFragment(Throwable $exception): string
5555
{
5656
$html = sprintf(
5757
'<div><strong>Type:</strong> %s</div>',
58-
$this->escapeHtml(get_class($exception)),
58+
$this->escapeHtml($exception::class),
5959
);
6060

6161
$code = $exception instanceof ErrorException ? $exception->getSeverity() : $exception->getCode();

Slim/Middleware/JsonExceptionMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ private function formatExceptionFragment(Throwable $exception): array
7878
$code = $exception instanceof ErrorException ? $exception->getSeverity() : $exception->getCode();
7979

8080
return [
81-
'type' => get_class($exception),
81+
'type' => $exception::class,
8282
'code' => $code,
8383
'message' => $exception->getMessage(),
8484
'file' => $exception->getFile(),

Slim/Middleware/PlainTextExceptionMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ private function createPayload(Throwable $exception): string
5656

5757
private function formatExceptionFragment(Throwable $exception): string
5858
{
59-
$text = sprintf("Type: %s\n", get_class($exception));
59+
$text = sprintf("Type: %s\n", $exception::class);
6060

6161
$code = $exception instanceof ErrorException ? $exception->getSeverity() : $exception->getCode();
6262

Slim/Middleware/XmlExceptionMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private function createPayload(Throwable $exception): string
5555
do {
5656
$exceptionElement = $dom->createElement('exception');
5757

58-
$typeElement = $dom->createElement('type', get_class($exception));
58+
$typeElement = $dom->createElement('type', $exception::class);
5959
$exceptionElement->appendChild($typeElement);
6060

6161
$code = $exception instanceof ErrorException ? $exception->getSeverity() : $exception->getCode();

0 commit comments

Comments
 (0)