8000 bug #47955 [Security][Serializer] Add missing args to trigger_depreca… · symfony/symfony@d39de28 · GitHub
[go: up one dir, main page]

Skip to content

Commit d39de28

Browse files
committed
bug #47955 [Security][Serializer] Add missing args to trigger_deprecation (alamirault)
This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [Security][Serializer] Add missing args to trigger_deprecation | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> I found that an argument was missing to `trigger_deprecation` in AuthorizationChecker. Found other places with this problem. Commits ------- 1114ea8 [Security][Serializer] Add missing args to trigger_deprecation
2 parents 7616c8d + 1114ea8 commit d39de28

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/Symfony/Component/Security/Core/Authorization/AuthorizationChecker.php

-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ final public function isGranted($attribute, $subject = null): bool
8080
// @deprecated since Symfony 5.4
8181
if ($this->alwaysAuthenticate || !$authenticated = $token->isAuthenticated(false)) {
8282
if (!($authenticated ?? true)) {
83-
trigger_deprecation('symfony/core', '5.4', 'Returning false from "%s()" is deprecated, return null from "getUser()" instead.');
83+
trigger_deprecation('symfony/core', '5.4', 'Returning false from "%s::isAuthenticated()" is deprecated, return null from "getUser()" instead.', get_debug_type($token));
8484
}
8585
$this->tokenStorage->setToken($token = $this->authenticationManager->authenticate($token));
8686
}

src/Symfony/Component/Security/Http/Firewall/AccessListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public function authenticate(RequestEvent $event)
114114

115115
// @deprecated since Symfony 5.4
116116
if (method_exists($token, 'isAuthenticated') && !$token->isAuthenticated(false)) {
117-
trigger_deprecation('symfony/core', '5.4', 'Returning false from "%s()" is deprecated, return null from "getUser()" instead.');
117+
trigger_deprecation('symfony/core', '5.4', 'Returning false from "%s::isAuthenticated()" is deprecated, return null from "getUser()" instead.', get_debug_type($token));
118118

119119
if ($this->authManager) {
120120
$token = $this->authManager->authenticate($token);

src/Symfony/Component/Serializer/Normalizer/ArrayDenormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function setSerializer(SerializerInterface $serializer)
8989
}
9090

9191
if (Serializer::class !== debug_backtrace()[1]['class'] ?? null) {
92-
trigger_deprecation('symfony/serializer', '5.3', 'Calling "%s" is deprecated. Please call setDenormalizer() instead.');
92+
trigger_deprecation('symfony/serializer', '5.3', 'Calling "%s()" is deprecated. Please call setDenormalizer() instead.', __METHOD__);
9393
}
9494

9595
$this->setDenormalizer($serializer);

src/Symfony/Component/Serializer/Tests/Normalizer/ArrayDenormalizerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function testDenormalizeLegacy()
8989

9090
$denormalizer = new ArrayDenormalizer();
9191

92-
$this->expectDeprecation('Since symfony/serializer 5.3: Calling "%s" is deprecated. Please call setDenormalizer() instead.');
92+
$this->expectDeprecation('Since symfony/serializer 5.3: Calling "Symfony\Component\Serializer\Normalizer\ArrayDenormalizer::setSerializer()" is deprecated. Please call setDenormalizer() instead.');
9393
$denormalizer->setSerializer($serializer);
9494

9595
$result = $denormalizer->denormalize(

0 commit comments

Comments
 (0)
0