Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
qa: use ::class instead of get_class()
Signed-off-by: Matthew Weier O'Phinney <[email protected]>
  • Loading branch information
weierophinney committed Jul 11, 2023
commit 5551cd270f53bf3731320fbafd7e023176291b10
5 changes: 2 additions & 3 deletions src/Controller/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
use RuntimeException;
use Webmozart\Assert\Assert;

use function get_class;
use function gettype;
use function is_callable;
use function is_object;
Expand Down Expand Up @@ -52,7 +51,7 @@ public function __construct($serverFactory, UserIdProviderInterface $userIdProvi
if (! is_callable($serverFactory)) {
throw new InvalidArgumentException(sprintf(
'OAuth2 Server factory must be a PHP callable; received %s',
is_object($serverFactory) ? get_class($serverFactory) : gettype($serverFactory)
is_object($serverFactory) ? $serverFactory::class : gettype($serverFactory)
));
}
$this->serverFactory = $serverFactory;
Expand Down Expand Up @@ -367,7 +366,7 @@ private function getOAuth2Server($type)
if (! $server instanceof OAuth2Server) {
throw new RuntimeException(sprintf(
'OAuth2\Server factory did not return a valid instance; received %s',
is_object($server) ? get_class($server) : gettype($server)
is_object($server) ? $server::class : gettype($server)
));
}
$this->server = $server;
Expand Down
5 changes: 2 additions & 3 deletions test/Adapter/Pdo/ScopeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use OAuth2\Storage\ScopeInterface;

use function explode;
use function get_class;
use function sort;
use function sprintf;

Expand All @@ -28,7 +27,7 @@ public function testScopeExists(object $storage): void
// incompatible storage
$this->markTestSkipped(sprintf(
'Skipped Storage of type %s; does not implement %s ',
get_class($storage),
$storage::class,
ScopeInterface::class
));
return;
Expand All @@ -55,7 +54,7 @@ public function testGetDefaultScope(object $storage): void
// incompatible storage
$this->markTestSkipped(sprintf(
'Skipped Storage of type %s; does not implement %s ',
get_class($storage),
$storage::class,
ScopeInterface::class
));
return;
Expand Down