Skip to content

Commit d8283d1

Browse files
author
roadiz-ci
committed
Merge branch hotfix/v2.6.17
1 parent 2bbad99 commit d8283d1

16 files changed

+135
-106
lines changed

.github/workflows/run-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
strategy:
2121
matrix:
22-
php-version: ['8.2', '8.3']
22+
php-version: ['8.3', '8.4']
2323
steps:
2424
- uses: shivammathur/setup-php@v2
2525
with:

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright © 2024 Ambroise Maupate
3+
Copyright © 2025 Ambroise Maupate
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66

composer.json

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,29 @@
2020
"minimum-stability": "dev",
2121
"prefer-stable": true,
2222
"require": {
23-
"php": ">=8.2",
23+
"php": ">=8.3",
2424
"doctrine/orm": "~2.20.0",
2525
"endroid/qr-code": "^4.0",
26-
"roadiz/core-bundle": "2.5.*",
27-
"roadiz/rozier": "2.5.*",
28-
"roadiz/rozier-bundle": "2.5.*",
26+
"roadiz/core-bundle": "2.6.*",
27+
"roadiz/rozier-bundle": "2.6.*",
2928
"scheb/2fa-backup-code": "^7.5",
3029
"scheb/2fa-bundle": "^7.5",
3130
"scheb/2fa-google-authenticator": "^7.5",
3231
"scheb/2fa-totp": "^7.5",
3332
"scheb/2fa-trusted-device": "^7.5",
34-
"symfony/framework-bundle": "6.4.*"
33+
"symfony/framework-bundle": "7.3.*"
3534
},
3635
"require-dev": {
3736
"php-coveralls/php-coveralls": "^2.4",
3837
"phpstan/phpstan": "^1.5.3",
3938
"phpstan/phpdoc-parser": "<2",
4039
"phpstan/phpstan-doctrine": "^1.3",
41-
"phpunit/phpunit": "^9.5",
42-
"roadiz/doc-generator": "2.5.*",
43-
"roadiz/entity-generator": "2.5.*",
44-
"roadiz/jwt": "2.5.*",
45-
"roadiz/random": "2.5.*",
46-
"symfony/stopwatch": "6.4.*"
40+
"phpunit/phpunit": "^9.6",
41+
"roadiz/doc-generator": "2.6.*",
42+
"roadiz/entity-generator": "2.6.*",
43+
"roadiz/jwt": "2.6.*",
44+
"roadiz/random": "2.6.*",
45+
"symfony/stopwatch": "7.3.*"
4746
},
4847
"config": {
4948
"optimize-autoloader": true,
@@ -70,8 +69,8 @@
7069
},
7170
"extra": {
7271
"branch-alias": {
73-
"dev-main": "2.5.x-dev",
74-
"dev-develop": "2.6.x-dev"
72+
"dev-main": "2.6.x-dev",
73+
"dev-develop": "2.7.x-dev"
7574
}
7675
}
7776
}

src/Backup/BackupCodeManager.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public function __construct(
1818
) {
1919
}
2020

21+
#[\Override]
2122
public function isBackupCode(object $user, string $code): bool
2223
{
2324
if ($user instanceof User) {
@@ -31,6 +32,7 @@ public function isBackupCode(object $user, string $code): bool
3132
return false;
3233
}
3334

35+
#[\Override]
3436
public function invalidateBackupCode(object $user, string $code): void
3537
{
3638
if ($user instanceof User) {

src/Console/DisableTwoFactorUserCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
)]
1818
final class DisableTwoFactorUserCommand extends UsersCommand
1919
{
20+
#[\Override]
2021
protected function configure(): void
2122
{
2223
$this->addArgument(
@@ -26,6 +27,7 @@ protected function configure(): void
2627
);
2728
}
2829

30+
#[\Override]
2931
protected function execute(InputInterface $input, OutputInterface $output): int
3032
{
3133
$io = new SymfonyStyle($input, $output);

src/Console/UsersCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public function __construct(
2323
parent::__construct($managerRegistry, $name);
2424
}
2525

26+
#[\Override]
2627
protected function getUserTableRow(User $user): array
2728
{
2829
$twoFactorUser = $this->twoFactorUserProvider->getFromUser($user);

src/DependencyInjection/Compiler/DoctrineMigrationCompilerPass.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
class DoctrineMigrationCompilerPass implements CompilerPassInterface
1111
{
12+
#[\Override]
1213
public function process(ContainerBuilder $container): void
1314
{
1415
if ($container->hasDefinition('doctrine.migrations.configuration')) {

src/DependencyInjection/RoadizTwoFactorExtension.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
class RoadizTwoFactorExtension extends Extension
1313
{
14+
#[\Override]
1415
public function getAlias(): string
1516
{
1617
return 'roadiz_two_factor';
@@ -19,6 +20,7 @@ public function getAlias(): string
1920
/**
2021
* @throws \Exception
2122
*/
23+
#[\Override]
2224
public function load(array $configs, ContainerBuilder $container): void
2325
{
2426
$loader = new YamlFileLoader($container, new FileLocator(dirname(__DIR__).'/../config'));

src/Entity/TwoFactorUser.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,13 @@ public function setDigits(?int $digits): TwoFactorUser
121121
return $this;
122122
}
123123

124+
#[\Override]
124125
public function isTotpAuthenticationEnabled(): bool
125126
{
126127
return (bool) $this->secret && null !== $this->activatedAt;
127128
}
128129

130+
#[\Override]
129131
public function getTotpAuthenticationUsername(): string
130132
{
131133
if (null === $this->user) {
@@ -135,12 +137,14 @@ public function getTotpAuthenticationUsername(): string
135137
return $this->user->getUserIdentifier();
136138
}
137139

140+
#[\Override]
138141
public function getTotpAuthenticationConfiguration(): ?TotpConfigurationInterface
139142
{
140143
// You could persist the other configuration options in the user entity to make it individual per user.
141144
return new TotpConfiguration($this->secret, $this->getAlgorithm(), $this->getPeriod(), $this->getDigits());
142145
}
143146

147+
#[\Override]
144148
public function isGoogleAuthenticatorEnabled(): bool
145149
{
146150
return (bool) $this->secret
@@ -151,6 +155,7 @@ public function isGoogleAuthenticatorEnabled(): bool
151155
;
152156
}
153157

158+
#[\Override]
154159
public function getGoogleAuthenticatorUsername(): string
155160
{
156161
if (null === $this->user) {
@@ -160,6 +165,7 @@ public function getGoogleAuthenticatorUsername(): string
160165
return $this->user->getUserIdentifier();
161166
}
162167

168+
#[\Override]
163169
public function getGoogleAuthenticatorSecret(): ?string
164170
{
165171
return $this->secret;
@@ -168,11 +174,12 @@ public function getGoogleAuthenticatorSecret(): ?string
168174
/**
169175
* Check if it is a valid backup code.
170176
*/
177+
#[\Override]
171178
public function isBackupCode(string $code): bool
172179
{
173180
// Loop over all backup codes and check if the code is valid
174181
foreach ($this->backupCodes as $backupCode) {
175-
if (password_verify($code, $backupCode)) {
182+
if (password_verify($code, (string) $backupCode)) {
176183
return true;
177184
}
178185
}
@@ -183,11 +190,12 @@ public function isBackupCode(string $code): bool
183190
/**
184191
* Invalidate a backup code.
185192
*/
193+
#[\Override]
186194
public function invalidateBackupCode(string $code): void
187195
{
188196
// Loop over all backup codes and check if the code is valid to invalidate it
189197
foreach ($this->backupCodes as $key => $backupCode) {
190-
if (password_verify($code, $backupCode)) {
198+
if (password_verify($code, (string) $backupCode)) {
191199
unset($this->backupCodes[$key]);
192200
$this->backupCodes = array_values($this->backupCodes);
193201
}
@@ -204,6 +212,7 @@ public function addBackUpCode(string $backUpCode): void
204212
}
205213
}
206214

215+
#[\Override]
207216
public function getTrustedTokenVersion(): int
208217
{
209218
return $this->trustedVersion;

src/EventSubscriber/UserActionsMenuEventSubscriber.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
namespace RZ\Roadiz\TwoFactorBundle\EventSubscriber;
66

7+
use RZ\Roadiz\RozierBundle\Event\UserActionsMenuEvent;
78
use Symfony\Bundle\SecurityBundle\Security;
89
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
910
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
10-
use Themes\Rozier\Event\UserActionsMenuEvent;
1111

1212
final readonly class UserActionsMenuEventSubscriber implements EventSubscriberInterface
1313
{
@@ -17,6 +17,7 @@ public function __construct(
1717
) {
1818
}
1919

20+
#[\Override]
2021
public static function getSubscribedEvents(): array
2122
{
2223
return [

0 commit comments

Comments
 (0)