Skip to content

Commit f06e403

Browse files
committed
Leverage class name literal on object
1 parent 75d4749 commit f06e403

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Command/CompleteCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@ protected function execute(InputInterface $input, OutputInterface $output): int
134134
$completionInput->bind($command->getDefinition());
135135

136136
if (CompletionInput::TYPE_OPTION_NAME === $completionInput->getCompletionType()) {
137-
$this->log(' Completing option names for the <comment>'.\get_class($command instanceof LazyCommand ? $command->getCommand() : $command).'</> command.');
137+
$this->log(' Completing option names for the <comment>'.($command instanceof LazyCommand ? $command->getCommand() : $command)::class.'</> command.');
138138

139139
$suggestions->suggestOptions($command->getDefinition()->getOptions());
140140
} else {
141141
$this->log([
142-
' Completing using the <comment>'.\get_class($command instanceof LazyCommand ? $command->getCommand() : $command).'</> class.',
142+
' Completing using the <comment>'.($command instanceof LazyCommand ? $command->getCommand() : $command)::class.'</> class.',
143143
' Completing <comment>'.$completionInput->getCompletionType().'</> for <comment>'.$completionInput->getCompletionName().'</>',
144144
]);
145145
if (null !== $compval = $completionInput->getCompletionValue()) {

Tests/ApplicationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,7 @@ public function testRenderAnonymousException()
922922
$application = new Application();
923923
$application->setAutoExit(false);
924924
$application->register('foo')->setCode(function () {
925-
throw new \InvalidArgumentException(sprintf('Dummy type "%s" is invalid.', \get_class(new class() { })));
925+
throw new \InvalidArgumentException(sprintf('Dummy type "%s" is invalid.', (new class() { })::class));
926926
});
927927
$tester = new ApplicationTester($application);
928928

@@ -948,7 +948,7 @@ public function testRenderExceptionStackTraceContainsRootException()
948948
$application = new Application();
949949
$application->setAutoExit(false);
950950
$application->register('foo')->setCode(function () {
951-
throw new \InvalidArgumentException(sprintf('Dummy type "%s" is invalid.', \get_class(new class() { })));
951+
throw new \InvalidArgumentException(sprintf('Dummy type "%s" is invalid.', (new class() { })::class));
952952
});
953953
$tester = new ApplicationTester($application);
954954

0 commit comments

Comments
 (0)