Skip to content

Commit 41773f1

Browse files
committed
minor #47401 Replace get_class() calls by ::class (deguif)
This PR was squashed before being merged into the 6.2 branch. Discussion ---------- Replace get_class() calls by ::class | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | Replace `get_class()` by `::class` Commits ------- 675601b8f7 Replace get_class() calls by ::class
2 parents 3d45a72 + 56f9a1b commit 41773f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Tests/ErrorHandlerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ public function testHandleErrorWithAnonymousClass()
327327

328328
$handler = ErrorHandler::register();
329329
try {
330-
trigger_error('foo '.\get_class($anonymousObject).' bar', \E_USER_WARNING);
330+
trigger_error('foo '.$anonymousObject::class.' bar', \E_USER_WARNING);
331331
$this->fail('Exception expected.');
332332
} catch (\ErrorException $e) {
333333
} finally {
@@ -372,7 +372,7 @@ public function testHandleException(string $expectedMessage, \Throwable $excepti
372372
$logArgCheck = function ($level, $message, $context) use ($expectedMessage, $exception) {
373373
$this->assertSame($expectedMessage, $message);
374374
$this->assertArrayHasKey('exception', $context);
375-
$this->assertInstanceOf(\get_class($exception), $context['exception']);
375+
$this->assertInstanceOf($exception::class, $context['exception']);
376376
};
377377

378378
$logger

0 commit comments

Comments
 (0)