Skip to content

Commit acae634

Browse files
deguiffabpot
authored andcommitted
Replace get_class() calls by ::class
1 parent c38df8e commit acae634

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Authorization/AccessDecisionManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private function getVoters(array $attributes, $object = null): iterable
8686
$keyAttributes[] = \is_string($attribute) ? $attribute : null;
8787
}
8888
// use `get_class` to handle anonymous classes
89-
$keyObject = \is_object($object) ? \get_class($object) : get_debug_type($object);
89+
$keyObject = \is_object($object) ? $object::class : get_debug_type($object);
9090
foreach ($this->voters as $key => $voter) {
9191
if (!$voter instanceof CacheableVoterInterface) {
9292
yield $voter;

Signature/SignatureHasher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function computeSignatureHash(UserInterface $user, int $expires): string
8888
}
8989

9090
if (!\is_scalar($value) && !$value instanceof \Stringable) {
91-
throw new \InvalidArgumentException(sprintf('The property path "%s" on the user object "%s" must return a value that can be cast to a string, but "%s" was returned.', $property, \get_class($user), get_debug_type($value)));
91+
throw new \InvalidArgumentException(sprintf('The property path "%s" on the user object "%s" must return a value that can be cast to a string, but "%s" was returned.', $property, $user::class, get_debug_type($value)));
9292
}
9393
$signatureFields[] = base64_encode($value);
9494
}

0 commit comments

Comments
 (0)