mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-01 05:54:32 +02:00
Fixed code style.
This commit is contained in:
parent
2853e471c4
commit
d0b1024d80
212 changed files with 495 additions and 1005 deletions
|
@ -200,8 +200,6 @@ class EventLoggerSubscriber implements EventSubscriber
|
|||
|
||||
/**
|
||||
* Checks if the field of the given element should be saved (if it is not blacklisted).
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function shouldFieldBeSaved(AbstractDBElement $element, string $field_name): bool
|
||||
{
|
||||
|
@ -297,14 +295,12 @@ class EventLoggerSubscriber implements EventSubscriber
|
|||
|
||||
/**
|
||||
* Filter out every forbidden field and return the cleaned array.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function filterFieldRestrictions(AbstractDBElement $element, array $fields): array
|
||||
{
|
||||
unset($fields['lastModified']);
|
||||
|
||||
if (! $this->hasFieldRestrictions($element)) {
|
||||
if (!$this->hasFieldRestrictions($element)) {
|
||||
return $fields;
|
||||
}
|
||||
|
||||
|
@ -322,7 +318,7 @@ class EventLoggerSubscriber implements EventSubscriber
|
|||
{
|
||||
$uow = $em->getUnitOfWork();
|
||||
|
||||
if (! $logEntry instanceof ElementEditedLogEntry && ! $logEntry instanceof ElementDeletedLogEntry) {
|
||||
if (!$logEntry instanceof ElementEditedLogEntry && !$logEntry instanceof ElementDeletedLogEntry) {
|
||||
throw new \InvalidArgumentException('$logEntry must be ElementEditedLogEntry or ElementDeletedLogEntry!');
|
||||
}
|
||||
|
||||
|
@ -349,12 +345,12 @@ class EventLoggerSubscriber implements EventSubscriber
|
|||
/**
|
||||
* Check if the given entity can be logged.
|
||||
*
|
||||
* @return bool True, if the given entity can be logged.
|
||||
* @return bool true, if the given entity can be logged
|
||||
*/
|
||||
protected function validEntity(object $entity): bool
|
||||
{
|
||||
//Dont log logentries itself!
|
||||
if ($entity instanceof AbstractDBElement && ! $entity instanceof AbstractLogEntry) {
|
||||
if ($entity instanceof AbstractDBElement && !$entity instanceof AbstractLogEntry) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ class LogAccessDeniedSubscriber implements EventSubscriberInterface
|
|||
$throwable = $throwable->getPrevious();
|
||||
}
|
||||
//Ignore everything except AccessDeniedExceptions
|
||||
if (! $throwable instanceof AccessDeniedException) {
|
||||
if (!$throwable instanceof AccessDeniedException) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,6 @@ use Doctrine\Common\EventSubscriber;
|
|||
use Doctrine\Migrations\DependencyFactory;
|
||||
use Doctrine\Migrations\Event\MigrationsEventArgs;
|
||||
use Doctrine\Migrations\Events;
|
||||
use Doctrine\Migrations\Version\AliasResolver;
|
||||
|
||||
/**
|
||||
* This subscriber logs databaseMigrations to Event log.
|
||||
|
|
|
@ -45,11 +45,7 @@ namespace App\EventSubscriber\LogSystem;
|
|||
use App\Entity\LogSystem\UserLogoutLogEntry;
|
||||
use App\Entity\UserSystem\User;
|
||||
use App\Services\LogSystem\EventLogger;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
use Symfony\Component\Security\Http\Event\LogoutEvent;
|
||||
use Symfony\Component\Security\Http\Logout\LogoutHandlerInterface;
|
||||
|
||||
/**
|
||||
* This handler logs to event log, if a user logs out.
|
||||
|
@ -65,13 +61,12 @@ class LogoutLoggerListener
|
|||
$this->gpdr_compliance = $gpdr_compliance;
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(LogoutEvent $event)
|
||||
{
|
||||
$request = $event->getRequest();
|
||||
$token = $event->getToken();
|
||||
|
||||
if ($token === null) {
|
||||
if (null === $token) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue