Skip to content

Commit

Permalink
chore: Bumped
Browse files Browse the repository at this point in the history
  • Loading branch information
roadiz-ci committed Sep 24, 2024
1 parent 101b475 commit 6a3c3f5
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 37 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 © 2024 Ambroise Maupate
Copyright © 2023 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: 8 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,29 @@
}
],
"type": "symfony-bundle",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=8.1",
"doctrine/orm": "~2.19.0",
"doctrine/orm": "~2.17.0",
"endroid/qr-code": "^4.0",
"roadiz/core-bundle": "2.3.*",
"roadiz/rozier-bundle": "2.3.*",
"roadiz/rozier": "2.3.*",
"roadiz/core-bundle": "2.2.*",
"roadiz/rozier-bundle": "2.2.*",
"roadiz/rozier": "2.2.*",
"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": "6.4.*"
"symfony/framework-bundle": "5.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": "6.4.*",
"roadiz/entity-generator": "2.3.*",
"roadiz/doc-generator": "2.3.*",
"roadiz/random": "2.3.*",
"roadiz/jwt": "2.3.*"
"symfony/stopwatch": "5.4.*"
},
"config": {
"optimize-autoloader": true,
Expand All @@ -71,8 +66,8 @@
},
"extra": {
"branch-alias": {
"dev-main": "2.3.x-dev",
"dev-develop": "2.4.x-dev"
"dev-main": "2.2.x-dev",
"dev-develop": "2.3.x-dev"
}
}
}
6 changes: 3 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
parameters:
level: 7
level: 5
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 @@ -30,5 +28,7 @@ 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 readonly TwoFactorUserProviderInterface $twoFactorUserProvider,
private readonly PersisterInterface $persister
private TwoFactorUserProviderInterface $twoFactorUserProvider,
private PersisterInterface $persister
) {
}

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

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 @@ -17,6 +20,18 @@
)]
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: 5 additions & 2 deletions src/Console/UsersCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@
name: 'users:list',
description: 'List all users or just one'
)]
class UsersCommand extends \RZ\Roadiz\CoreBundle\Console\UsersCommand
final class UsersCommand extends \RZ\Roadiz\CoreBundle\Console\UsersCommand
{
private TwoFactorUserProviderInterface $twoFactorUserProvider;

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

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

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 @@ -16,7 +17,7 @@
final class BackupCodesAdminController extends RozierApp
{
public function __construct(
private readonly TwoFactorUserProviderInterface $twoFactorUserProvider
private 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 readonly TwoFactorUserProviderInterface $twoFactorUserProvider,
private readonly TotpAuthenticatorInterface $totpAuthenticator,
private readonly GoogleAuthenticatorInterface $googleAuthenticator
private TwoFactorUserProviderInterface $twoFactorUserProvider,
private TotpAuthenticatorInterface $totpAuthenticator,
private 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 readonly TwoFactorUserProviderInterface $twoFactorUserProvider,
private readonly AuthenticatorTwoFactorProvider $authenticatorTwoFactorProvider,
private TwoFactorUserProviderInterface $twoFactorUserProvider,
private AuthenticatorTwoFactorProvider $authenticatorTwoFactorProvider,
) {
}

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

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

final class UserActionsMenuEventSubscriber implements EventSubscriberInterface
{
public function __construct(
private readonly UrlGeneratorInterface $urlGenerator,
private readonly Security $security
) {
public function __construct(private UrlGeneratorInterface $urlGenerator, private 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 readonly TwoFactorUserProviderInterface $twoFactorUserProvider,
private readonly TotpAuthenticatorInterface $authenticator,
private readonly TwoFactorFormRendererInterface $formRenderer,
private TwoFactorUserProviderInterface $twoFactorUserProvider,
private TotpAuthenticatorInterface $authenticator,
private 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 readonly ManagerRegistry $managerRegistry,
private readonly TotpAuthenticatorInterface $totpAuthenticator
private ManagerRegistry $managerRegistry,
private TotpAuthenticatorInterface $totpAuthenticator
) {
}

Expand Down

0 comments on commit 6a3c3f5

Please sign in to comment.