Skip to content

Commit

Permalink
Merge branch hotfix/v2.3.19
Browse files Browse the repository at this point in the history
  • Loading branch information
roadiz-ci committed Jul 12, 2024
1 parent 98a9e52 commit 101b475
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 49 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright © 2023 Ambroise Maupate
Copyright © 2024 Ambroise Maupate

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:

Expand Down
21 changes: 13 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,34 @@
}
],
"type": "symfony-bundle",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=8.1",
"doctrine/orm": "~2.17.0",
"doctrine/orm": "~2.19.0",
"endroid/qr-code": "^4.0",
"roadiz/core-bundle": "2.2.*",
"roadiz/rozier-bundle": "2.2.*",
"roadiz/rozier": "2.2.*",
"roadiz/core-bundle": "2.3.*",
"roadiz/rozier-bundle": "2.3.*",
"roadiz/rozier": "2.3.*",
"scheb/2fa-backup-code": "^6.8",
"scheb/2fa-bundle": "^6.8",
"scheb/2fa-totp": "^6.8",
"scheb/2fa-google-authenticator": "^6.8",
"scheb/2fa-trusted-device": "^6.8",
"sensio/framework-extra-bundle": "^6.1",
"symfony/framework-bundle": "5.4.*"
"symfony/framework-bundle": "6.4.*"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.4",
"phpstan/phpstan": "^1.5.3",
"phpstan/phpstan-doctrine": "^1.3",
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.5",
"symfony/stopwatch": "5.4.*"
"symfony/stopwatch": "6.4.*",
"roadiz/entity-generator": "2.3.*",
"roadiz/doc-generator": "2.3.*",
"roadiz/random": "2.3.*",
"roadiz/jwt": "2.3.*"
},
"config": {
"optimize-autoloader": true,
Expand All @@ -66,8 +71,8 @@
},
"extra": {
"branch-alias": {
"dev-main": "2.2.x-dev",
"dev-develop": "2.3.x-dev"
"dev-main": "2.3.x-dev",
"dev-develop": "2.4.x-dev"
}
}
}
6 changes: 3 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
parameters:
level: 5
level: 7
paths:
- src
excludePaths:
- */node_modules/*
- */bower_components/*
- */static/*
ignoreErrors:
- identifier: missingType.iterableValue
- identifier: missingType.generics
- '#Call to an undefined method RZ\\Roadiz\\CoreBundle\\Repository#'
- '#Call to an undefined method RZ\\Roadiz\\UserBundle\\Repository#'
- '#Call to an undefined method Doctrine\\Persistence\\ObjectRepository#'
Expand All @@ -28,7 +30,5 @@ parameters:
- '#does not accept Doctrine\\Common\\Collections\\ReadableCollection<int, [^\>]+>#'

reportUnmatchedIgnoredErrors: false
checkGenericClassInNonGenericObjectType: false
checkMissingIterableValueType: false
includes:
- vendor/phpstan/phpstan-doctrine/extension.neon
4 changes: 2 additions & 2 deletions src/Backup/BackupCodeManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
final class BackupCodeManager implements BackupCodeManagerInterface
{
public function __construct(
private TwoFactorUserProviderInterface $twoFactorUserProvider,
private PersisterInterface $persister
private readonly TwoFactorUserProviderInterface $twoFactorUserProvider,
private readonly PersisterInterface $persister
) {
}

Expand Down
15 changes: 0 additions & 15 deletions src/Console/DisableTwoFactorUserCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@

namespace RZ\Roadiz\TwoFactorBundle\Console;

use Doctrine\Persistence\ManagerRegistry;
use RZ\Roadiz\CoreBundle\Console\UsersCommand;
use RZ\Roadiz\TwoFactorBundle\Entity\TwoFactorUser;
use RZ\Roadiz\TwoFactorBundle\Security\Provider\TwoFactorUserProviderInterface;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand All @@ -20,18 +17,6 @@
)]
final class DisableTwoFactorUserCommand extends UsersCommand
{
private TwoFactorUserProviderInterface $twoFactorUserProvider;

public function __construct(
ManagerRegistry $managerRegistry,
TwoFactorUserProviderInterface $twoFactorUserProvider,
string $name = null
) {
parent::__construct($managerRegistry, $name);
$this->twoFactorUserProvider = $twoFactorUserProvider;
$this->managerRegistry = $managerRegistry;
}

protected function configure(): void
{
$this->addArgument(
Expand Down
7 changes: 2 additions & 5 deletions src/Console/UsersCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,14 @@
name: 'users:list',
description: 'List all users or just one'
)]
final class UsersCommand extends \RZ\Roadiz\CoreBundle\Console\UsersCommand
class UsersCommand extends \RZ\Roadiz\CoreBundle\Console\UsersCommand
{
private TwoFactorUserProviderInterface $twoFactorUserProvider;

public function __construct(
TwoFactorUserProviderInterface $twoFactorUserProvider,
protected readonly TwoFactorUserProviderInterface $twoFactorUserProvider,
ManagerRegistry $managerRegistry,
string $name = null
) {
parent::__construct($managerRegistry, $name);
$this->twoFactorUserProvider = $twoFactorUserProvider;
}

protected function getUserTableRow(User $user): array
Expand Down
3 changes: 1 addition & 2 deletions src/Controller/BackupCodesAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use RZ\Roadiz\CoreBundle\Entity\User;
use RZ\Roadiz\TwoFactorBundle\Entity\TwoFactorUser;
use RZ\Roadiz\TwoFactorBundle\Security\Provider\AuthenticatorTwoFactorProvider;
use RZ\Roadiz\TwoFactorBundle\Security\Provider\TwoFactorUserProviderInterface;
use Symfony\Component\Form\Extension\Core\Type\FormType;
use Symfony\Component\HttpFoundation\Request;
Expand All @@ -17,7 +16,7 @@
final class BackupCodesAdminController extends RozierApp
{
public function __construct(
private TwoFactorUserProviderInterface $twoFactorUserProvider
private readonly TwoFactorUserProviderInterface $twoFactorUserProvider
) {
}

Expand Down
6 changes: 3 additions & 3 deletions src/Controller/QrCodeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
final class QrCodeController extends AbstractController
{
public function __construct(
private TwoFactorUserProviderInterface $twoFactorUserProvider,
private TotpAuthenticatorInterface $totpAuthenticator,
private GoogleAuthenticatorInterface $googleAuthenticator
private readonly TwoFactorUserProviderInterface $twoFactorUserProvider,
private readonly TotpAuthenticatorInterface $totpAuthenticator,
private readonly GoogleAuthenticatorInterface $googleAuthenticator
) {
}

Expand Down
4 changes: 2 additions & 2 deletions src/Controller/TwoFactorAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
final class TwoFactorAdminController extends RozierApp
{
public function __construct(
private TwoFactorUserProviderInterface $twoFactorUserProvider,
private AuthenticatorTwoFactorProvider $authenticatorTwoFactorProvider,
private readonly TwoFactorUserProviderInterface $twoFactorUserProvider,
private readonly AuthenticatorTwoFactorProvider $authenticatorTwoFactorProvider,
) {
}

Expand Down
8 changes: 5 additions & 3 deletions src/EventSubscriber/UserActionsMenuEventSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@

use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Core\Security;
use Symfony\Bundle\SecurityBundle\Security;
use Themes\Rozier\Event\UserActionsMenuEvent;

final class UserActionsMenuEventSubscriber implements EventSubscriberInterface
{
public function __construct(private UrlGeneratorInterface $urlGenerator, private Security $security)
{
public function __construct(
private readonly UrlGeneratorInterface $urlGenerator,
private readonly Security $security
) {
}

public static function getSubscribedEvents(): array
Expand Down
6 changes: 3 additions & 3 deletions src/Security/Provider/AuthenticatorTwoFactorProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
final class AuthenticatorTwoFactorProvider implements TwoFactorProviderInterface
{
public function __construct(
private TwoFactorUserProviderInterface $twoFactorUserProvider,
private TotpAuthenticatorInterface $authenticator,
private TwoFactorFormRendererInterface $formRenderer,
private readonly TwoFactorUserProviderInterface $twoFactorUserProvider,
private readonly TotpAuthenticatorInterface $authenticator,
private readonly TwoFactorFormRendererInterface $formRenderer,
) {
}

Expand Down
4 changes: 2 additions & 2 deletions src/Security/Provider/TwoFactorUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
final class TwoFactorUserProvider implements TwoFactorUserProviderInterface
{
public function __construct(
private ManagerRegistry $managerRegistry,
private TotpAuthenticatorInterface $totpAuthenticator
private readonly ManagerRegistry $managerRegistry,
private readonly TotpAuthenticatorInterface $totpAuthenticator
) {
}

Expand Down

0 comments on commit 101b475

Please sign in to comment.