8000 minor #53720 [MonologBridge] Support symfony/security-core 5.4 again … · symfony/symfony@c8f720c · GitHub
[go: up one dir, main page]

Skip to content

Commit c8f720c

Browse files
minor #53720 [MonologBridge] Support symfony/security-core 5.4 again (derrabus)
This PR was merged into the 6.4 branch. Discussion ---------- [MonologBridge] Support symfony/security-core 5.4 again | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #53699 | License | MIT This change should allow the installation of MonologBridge 6.4 in Symfony 5.4 projects that want to use Monolog 3. Commits ------- c5d8fba [MonologBridge] Support symfony/security-core 5.4 again
2 parents 752483b + c5d8fba commit c8f720c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Symfony/Bridge/Monolog/Processor/AbstractTokenProcessor.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ private function doInvoke(array|LogRecord $record): array|LogRecord
5151
'roles' => $token->getRoleNames(),
5252
];
5353

54-
$record['extra'][$this->getKey()]['user_identifier'] = $token->getUserIdentifier();
54+
// @deprecated since Symfony 5.3, change to $token->getUserIdentifier() in 7.0
55+
$record['extra'][$this->getKey()]['user_identifier'] = method_exists($token, 'getUserIdentifier') ? $token->getUserIdentifier() : $token->getUsername();
5556
}
5657

5758
return $record;

src/Symfony/Bridge/Monolog/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"require-dev": {
2626
"symfony/console": "^5.4|^6.0|^7.0",
2727
"symfony/http-client": "^5.4|^6.0|^7.0",
28-
"symfony/security-core": "^6.0|^7.0",
28+
"symfony/security-core": "^5.4|^6.0|^7.0",
2929
"symfony/var-dumper": "^5.4|^6.0|^7.0",
3030
"symfony/mailer": "^5.4|^6.0|^7.0",
3131
"symfony/mime": "^5.4|^6.0|^7.0",
@@ -34,7 +34,7 @@
3434
"conflict": {
3535
"symfony/console": "<5.4",
3636
"symfony/http-foundation": "<5.4",
37-
"symfony/security-core": "<6.0"
37+
"symfony/security-core": "<5.4"
3838
},
3939
"autoload": {
4040
"psr-4": { "Symfony\\Bridge\\Monolog\\": "" },

0 commit comments

Comments
 (0)
0