mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-28 12:40:08 +02:00
Fixed coding style.
This commit is contained in:
parent
0a94689d98
commit
f2ff77a8b3
44 changed files with 435 additions and 387 deletions
|
@ -38,10 +38,10 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
|||
*/
|
||||
final class LoginSuccessListener implements EventSubscriberInterface
|
||||
{
|
||||
protected $translator;
|
||||
protected $flashBag;
|
||||
protected $eventLogger;
|
||||
protected $gpdr_compliance;
|
||||
private $translator;
|
||||
private $flashBag;
|
||||
private $eventLogger;
|
||||
private $gpdr_compliance;
|
||||
|
||||
public function __construct(TranslatorInterface $translator, FlashBagInterface $flashBag, EventLogger $eventLogger, bool $gpdr_compliance)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
|
||||
*
|
||||
|
@ -21,7 +24,6 @@
|
|||
|
||||
namespace App\EventSubscriber;
|
||||
|
||||
|
||||
use App\Entity\LogSystem\UserLogoutLogEntry;
|
||||
use App\Entity\UserSystem\User;
|
||||
use App\Services\LogSystem\EventLogger;
|
||||
|
@ -41,10 +43,7 @@ class LogoutListener implements LogoutHandlerInterface
|
|||
$this->gpdr_compliance = $gpdr_compliance;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function logout(Request $request, Response $response, TokenInterface $token)
|
||||
public function logout(Request $request, Response $response, TokenInterface $token): void
|
||||
{
|
||||
$log = new UserLogoutLogEntry($request->getClientIp(), $this->gpdr_compliance);
|
||||
$user = $token->getUser();
|
||||
|
@ -54,4 +53,4 @@ class LogoutListener implements LogoutHandlerInterface
|
|||
|
||||
$this->logger->logAndFlush($log);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,10 +34,10 @@ use Symfony\Component\Security\Core\Security;
|
|||
|
||||
final class LogoutOnDisabledUserListener implements EventSubscriberInterface
|
||||
{
|
||||
protected $security;
|
||||
protected $translator;
|
||||
protected $flashBag;
|
||||
protected $urlGenerator;
|
||||
private $security;
|
||||
private $translator;
|
||||
private $flashBag;
|
||||
private $urlGenerator;
|
||||
|
||||
public function __construct(Security $security, UrlGeneratorInterface $urlGenerator)
|
||||
{
|
||||
|
|
|
@ -31,8 +31,8 @@ use Symfony\Component\Mime\Email;
|
|||
|
||||
final class MailFromListener implements EventSubscriberInterface
|
||||
{
|
||||
protected $email;
|
||||
protected $name;
|
||||
private $email;
|
||||
private $name;
|
||||
|
||||
public function __construct(string $email, string $name)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
|
||||
*
|
||||
|
@ -21,12 +24,10 @@
|
|||
|
||||
namespace App\EventSubscriber;
|
||||
|
||||
|
||||
use App\Entity\LogSystem\DatabaseUpdatedLogEntry;
|
||||
use App\Services\LogSystem\EventLogger;
|
||||
use Doctrine\Common\EventSubscriber;
|
||||
use Doctrine\Migrations\Event\MigrationsEventArgs;
|
||||
use Doctrine\Migrations\Event\MigrationsVersionEventArgs;
|
||||
use Doctrine\Migrations\Events;
|
||||
|
||||
class MigrationListener implements EventSubscriber
|
||||
|
@ -55,33 +56,27 @@ class MigrationListener implements EventSubscriber
|
|||
$this->old_version = empty($this->old_version) ? 'legacy/empty' : $this->old_version;
|
||||
$this->new_version = empty($this->new_version) ? 'unknown' : $this->new_version;
|
||||
|
||||
|
||||
try {
|
||||
$log = new DatabaseUpdatedLogEntry($this->old_version, $this->new_version);
|
||||
$this->eventLogger->logAndFlush($log);
|
||||
} catch (\Exception $exception) {
|
||||
} catch (\Throwable $exception) {
|
||||
//Ignore any exception occuring here...
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function onMigrationsMigrating(MigrationsEventArgs $args): void
|
||||
{
|
||||
// Save the version before any migration
|
||||
if ($this->old_version == null) {
|
||||
if (null === $this->old_version) {
|
||||
$this->old_version = $args->getConfiguration()->getCurrentVersion();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getSubscribedEvents()
|
||||
{
|
||||
return [
|
||||
Events::onMigrationsMigrated,
|
||||
Events::onMigrationsMigrating,
|
||||
];
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,9 +55,9 @@ final class PasswordChangeNeededSubscriber implements EventSubscriberInterface
|
|||
* @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;
|
||||
protected $httpUtils;
|
||||
private $security;
|
||||
private $flashBag;
|
||||
private $httpUtils;
|
||||
|
||||
public function __construct(Security $security, FlashBagInterface $flashBag, HttpUtils $httpUtils)
|
||||
{
|
||||
|
|
|
@ -30,7 +30,7 @@ use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
|
|||
|
||||
final class SymfonyDebugToolbarSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
protected $kernel;
|
||||
private $kernel;
|
||||
|
||||
public function __construct(ContainerInterface $kernel)
|
||||
{
|
||||
|
|
|
@ -35,8 +35,8 @@ use Symfony\Component\Security\Core\Security;
|
|||
*/
|
||||
final class TimezoneListener implements EventSubscriberInterface
|
||||
{
|
||||
protected $default_timezone;
|
||||
protected $security;
|
||||
private $default_timezone;
|
||||
private $security;
|
||||
|
||||
public function __construct(string $timezone, Security $security)
|
||||
{
|
||||
|
|
|
@ -34,10 +34,10 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
|||
|
||||
final class U2FRegistrationSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
protected $em;
|
||||
private $em;
|
||||
|
||||
protected $demo_mode;
|
||||
protected $flashBag;
|
||||
private $demo_mode;
|
||||
private $flashBag;
|
||||
/**
|
||||
* @var UrlGeneratorInterface
|
||||
*/
|
||||
|
@ -51,9 +51,6 @@ final class U2FRegistrationSubscriber implements EventSubscriberInterface
|
|||
$this->flashBag = $flashBag;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue