chore: code cleanup

This commit is contained in:
Björn Fromme
2025-08-21 14:20:43 +02:00
parent c4e28818e0
commit e36009008c
273 changed files with 547 additions and 531 deletions
+2 -2
View File
@@ -30,7 +30,7 @@ class BpnAuthenticator extends AbstractLoginFormAuthenticator implements Authent
private readonly EntityManagerInterface $entityManager,
private readonly ApiClient $apiClient,
private readonly LoggerInterface $logger,
private readonly UserDataHandler $userDataHandler
private readonly UserDataHandler $userDataHandler,
) {
}
@@ -100,7 +100,7 @@ class BpnAuthenticator extends AbstractLoginFormAuthenticator implements Authent
ProfileResponse $profileResponse,
string $email,
string $password,
?string $preferredRole
?string $preferredRole,
): ?User {
// Fetch CRM attributes, early return in case of an API error
try {
+2 -1
View File
@@ -43,6 +43,7 @@ class ApplicationVoter extends Voter
if ($this->security->isGranted('ROLE_ADMINISTRATIVE') && in_array($attribute, $adminAttributes)) {
$assignment = $application->getAssignment();
return match ($attribute) {
static::STATUS, static::DELETE => true,
static::VIEW => Application::STATUS_REJECTED !== $status,
@@ -68,4 +69,4 @@ class ApplicationVoter extends Voter
return false;
}
}
}
+1 -2
View File
@@ -4,7 +4,6 @@ namespace App\Security\Voter;
use App\Entity\Application;
use App\Entity\Assignment;
use App\Entity\Disposition;
use App\Entity\User;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\SecurityBundle\Security;
@@ -21,7 +20,7 @@ class AssignmentVoter extends Voter
public function __construct(
private readonly Security $security,
private readonly EntityManagerInterface $entityManager
private readonly EntityManagerInterface $entityManager,
) {
}
+3 -2
View File
@@ -14,7 +14,8 @@ class AvailabilityVoter extends Voter
public const DELETE = 'DELETE';
public function __construct(private readonly Security $security)
{}
{
}
protected function supports(string $attribute, mixed $subject): bool
{
@@ -45,4 +46,4 @@ class AvailabilityVoter extends Voter
return null === $availability->getOwner() || $teamer === $availability->getOwner();
}
}
}
+1 -2
View File
@@ -48,8 +48,7 @@ class DispositionVoter extends Voter
$disposition = $subject;
return match ($attribute) {
static::VIEW, static::EDIT, static::CONTRACT, static::INVOICE =>
$this->security->isGranted('ROLE_ADMINISTRATIVE')
static::VIEW, static::EDIT, static::CONTRACT, static::INVOICE => $this->security->isGranted('ROLE_ADMINISTRATIVE')
|| $this->assertTeamerAccess($token, $disposition),
static::DELETE => $this->security->isGranted('ROLE_ADMIN'),
static::FEEDBACK => $this->security->isGranted('ROLE_ADMINISTRATIVE')
+1 -1
View File
@@ -33,4 +33,4 @@ class FeedbackSetVoter extends Voter
return null === $result;
}
}
}
+1 -1
View File
@@ -41,4 +41,4 @@ class FeedbackVoter extends Voter
return false;
}
}
}
+3 -2
View File
@@ -14,7 +14,8 @@ class LicenseVoter extends Voter
public const DELETE = 'DELETE';
public function __construct(private readonly Security $security)
{}
{
}
protected function supports(string $attribute, mixed $subject): bool
{
@@ -38,4 +39,4 @@ class LicenseVoter extends Voter
return $license->getTeamer() === $user->getTeamer();
}
}
}
+1 -1
View File
@@ -21,7 +21,7 @@ class UploadVoter extends Voter
protected function supports(string $attribute, mixed $subject): bool
{
if (! $subject instanceof Upload) {
if (!$subject instanceof Upload) {
return false;
}