Skip to content

Commit a9d0caa

Browse files
committed
Fixed some deprecations
1 parent 6ed4ad4 commit a9d0caa

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

src/Form/History/EnforceEventCommentTypesType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ public function getParent(): string
3838
return EnumType::class;
3939
}
4040

41-
public function configureOptions(OptionsResolver $resolver)
41+
public function configureOptions(OptionsResolver $resolver): void
4242
{
4343
$resolver->setDefaults([
4444
'multiple' => true,
4545
'class' => EventCommentType::class,
4646
'empty_data' => [],
4747
]);
4848
}
49-
}
49+
}

src/Form/Type/LocaleSelectType.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ public function getParent(): string
4444
return LocaleType::class;
4545
}
4646

47-
public function configureOptions(OptionsResolver $resolver)
47+
public function configureOptions(OptionsResolver $resolver): void
4848
{
4949
$resolver->setDefaults([
5050
'preferred_choices' => $this->preferred_languages,
5151
]);
5252
}
53-
}
53+
}

src/Security/UserChecker.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
namespace App\Security;
2424

2525
use App\Entity\UserSystem\User;
26+
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
2627
use Symfony\Component\Security\Core\Exception\AccountStatusException;
2728
use Symfony\Component\Security\Core\Exception\CustomUserMessageAccountStatusException;
2829
use Symfony\Component\Security\Core\User\UserCheckerInterface;
@@ -51,7 +52,7 @@ public function checkPreAuth(UserInterface $user): void
5152
*
5253
* @throws AccountStatusException
5354
*/
54-
public function checkPostAuth(UserInterface $user): void
55+
public function checkPostAuth(UserInterface $user, ?TokenInterface $token = null): void
5556
{
5657
if (!$user instanceof User) {
5758
return;

src/Security/Voter/BOMEntryVoter.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
use App\Entity\ProjectSystem\ProjectBOMEntry;
2828
use Symfony\Bundle\SecurityBundle\Security;
2929
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
30+
use Symfony\Component\Security\Core\Authorization\Voter\Vote;
3031
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
3132

3233
/**
@@ -46,7 +47,7 @@ protected function supports(string $attribute, mixed $subject): bool
4647
return $this->supportsAttribute($attribute) && is_a($subject, ProjectBOMEntry::class, true);
4748
}
4849

49-
protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token): bool
50+
protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token, ?Vote $vote = null): bool
5051
{
5152
if (!is_a($subject, ProjectBOMEntry::class, true)) {
5253
return false;
@@ -87,4 +88,4 @@ public function supportsType(string $subjectType): bool
8788
{
8889
return $subjectType === 'string' || is_a($subjectType, ProjectBOMEntry::class, true);
8990
}
90-
}
91+
}

src/Security/Voter/HasAccessPermissionsVoter.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use App\Services\UserSystem\PermissionManager;
2727
use App\Services\UserSystem\VoterHelper;
2828
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
29+
use Symfony\Component\Security\Core\Authorization\Voter\Vote;
2930
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
3031

3132
/**
@@ -41,7 +42,7 @@ public function __construct(private readonly PermissionManager $permissionManage
4142
{
4243
}
4344

44-
protected function voteOnAttribute(string $attribute, $subject, TokenInterface $token): bool
45+
protected function voteOnAttribute(string $attribute, $subject, TokenInterface $token, ?Vote $vote = null): bool
4546
{
4647
$user = $this->helper->resolveUser($token);
4748
return $this->permissionManager->hasAnyPermissionSetToAllowInherited($user);
@@ -56,4 +57,4 @@ public function supportsAttribute(string $attribute): bool
5657
{
5758
return $attribute === self::ROLE;
5859
}
59-
}
60+
}

0 commit comments

Comments
 (0)