mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-28 12:40:08 +02:00
Applied symplify rules to codebase.
This commit is contained in:
parent
2f20d90041
commit
388e847b17
136 changed files with 1370 additions and 789 deletions
|
@ -33,7 +33,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
|||
/**
|
||||
* This event listener shows an login successful flash to the user after login.
|
||||
*/
|
||||
class LoginSuccessListener implements EventSubscriberInterface
|
||||
final class LoginSuccessListener implements EventSubscriberInterface
|
||||
{
|
||||
protected $translator;
|
||||
protected $flashBag;
|
||||
|
|
|
@ -32,7 +32,7 @@ use Symfony\Component\HttpKernel\KernelEvents;
|
|||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
|
||||
class LogoutOnDisabledUserListener implements EventSubscriberInterface
|
||||
final class LogoutOnDisabledUserListener implements EventSubscriberInterface
|
||||
{
|
||||
protected $security;
|
||||
protected $translator;
|
||||
|
|
|
@ -29,7 +29,7 @@ use Symfony\Component\Mailer\Event\MessageEvent;
|
|||
use Symfony\Component\Mime\Address;
|
||||
use Symfony\Component\Mime\Email;
|
||||
|
||||
class MailFromListener implements EventSubscriberInterface
|
||||
final class MailFromListener implements EventSubscriberInterface
|
||||
{
|
||||
protected $email;
|
||||
protected $name;
|
||||
|
|
|
@ -37,7 +37,7 @@ use Symfony\Component\Security\Http\HttpUtils;
|
|||
* to setup a 2FA method (enforcement can be set per group).
|
||||
* In this cases the user is unable to access sites other than the whitelisted (see ALLOWED_ROUTES).
|
||||
*/
|
||||
class PasswordChangeNeededSubscriber implements EventSubscriberInterface
|
||||
final class PasswordChangeNeededSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
/**
|
||||
* @var string[] The routes the user is allowed to access without being redirected.
|
||||
|
@ -51,7 +51,9 @@ class PasswordChangeNeededSubscriber implements EventSubscriberInterface
|
|||
'logout',
|
||||
];
|
||||
|
||||
/** @var string The route the user will redirected to, if he needs to change this password */
|
||||
/**
|
||||
* @var string The route the user will redirected to, if he needs to change this password
|
||||
*/
|
||||
public const REDIRECT_TARGET = 'user_settings';
|
||||
protected $security;
|
||||
protected $flashBag;
|
||||
|
|
|
@ -28,7 +28,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
|||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
|
||||
|
||||
class SymfonyDebugToolbarSubscriber implements EventSubscriberInterface
|
||||
final class SymfonyDebugToolbarSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
protected $kernel;
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ use Symfony\Component\Security\Core\Security;
|
|||
/**
|
||||
* The purpose of this event listener is to set the timezone to the one preferred by the user.
|
||||
*/
|
||||
class TimezoneListener implements EventSubscriberInterface
|
||||
final class TimezoneListener implements EventSubscriberInterface
|
||||
{
|
||||
protected $default_timezone;
|
||||
protected $security;
|
||||
|
|
|
@ -32,13 +32,15 @@ use Symfony\Component\HttpFoundation\RedirectResponse;
|
|||
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;
|
||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
|
||||
class U2FRegistrationSubscriber implements EventSubscriberInterface
|
||||
final class U2FRegistrationSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
protected $em;
|
||||
|
||||
protected $demo_mode;
|
||||
protected $flashBag;
|
||||
/** @var UrlGeneratorInterface */
|
||||
/**
|
||||
* @var UrlGeneratorInterface
|
||||
*/
|
||||
private $router;
|
||||
|
||||
public function __construct(UrlGeneratorInterface $router, EntityManagerInterface $entityManager, FlashBagInterface $flashBag, bool $demo_mode)
|
||||
|
@ -49,7 +51,9 @@ class U2FRegistrationSubscriber implements EventSubscriberInterface
|
|||
$this->flashBag = $flashBag;
|
||||
}
|
||||
|
||||
/** @return string[] **/
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue