Update dependencies

This commit is contained in:
2025-09-08 19:50:23 +02:00
parent d80436534f
commit b7a570928a
15 changed files with 452 additions and 391 deletions

View File

@@ -29,6 +29,7 @@ readonly class AddSettingsCommand
if (null !== $season->getSettings()) {
continue;
}
$io->text('Adding settings to season : '.$season->getSeasonCode());
$season->setSettings(new SeasonSettings());
}

View File

@@ -7,6 +7,7 @@ namespace App\Controller\Admin;
use App\Entity\Answer;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
/** @extends AbstractCrudController<Answer> */
class AnswerCrudController extends AbstractCrudController
{
public static function getEntityFqcn(): string

View File

@@ -7,6 +7,7 @@ namespace App\Controller\Admin;
use App\Entity\Candidate;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
/** @extends AbstractCrudController<Candidate> */
class CandidateCrudController extends AbstractCrudController
{
public static function getEntityFqcn(): string

View File

@@ -7,6 +7,7 @@ namespace App\Controller\Admin;
use App\Entity\GivenAnswer;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
/** @extends AbstractCrudController<GivenAnswer> */
class GivenAnswerCrudController extends AbstractCrudController
{
public static function getEntityFqcn(): string

View File

@@ -7,6 +7,7 @@ namespace App\Controller\Admin;
use App\Entity\Question;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
/** @extends AbstractCrudController<Question> */
class QuestionCrudController extends AbstractCrudController
{
public static function getEntityFqcn(): string

View File

@@ -7,7 +7,8 @@ namespace App\Controller\Admin;
use App\Entity\QuizCandidate;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
class CorrectionCrudController extends AbstractCrudController
/** @extends AbstractCrudController<QuizCandidate> */
class QuizCorrectionCrudController extends AbstractCrudController
{
public static function getEntityFqcn(): string
{

View File

@@ -7,6 +7,7 @@ namespace App\Controller\Admin;
use App\Entity\Quiz;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
/** @extends AbstractCrudController<Quiz> */
class QuizCrudController extends AbstractCrudController
{
public static function getEntityFqcn(): string

View File

@@ -7,6 +7,7 @@ namespace App\Controller\Admin;
use App\Entity\Season;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
/** @extends AbstractCrudController<Season> */
class SeasonCrudController extends AbstractCrudController
{
public static function getEntityFqcn(): string

View File

@@ -7,6 +7,7 @@ namespace App\Controller\Admin;
use App\Entity\User;
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController;
/** @extends AbstractCrudController<User> */
class UserCrudController extends AbstractCrudController
{
public static function getEntityFqcn(): string

View File

@@ -57,6 +57,7 @@ final class RegistrationController extends AbstractController
} catch (TransportExceptionInterface $e) {
$logger->error($e->getMessage());
}
$response = $security->login($user, 'form_login', 'main');
\assert($response instanceof Response);

View File

@@ -39,15 +39,8 @@ class RegistrationFormType extends AbstractType
'second_options' => ['label' => $this->translator->trans('Repeat Password')],
'mapped' => false,
'constraints' => [
new NotBlank([
'message' => 'Please enter a password',
]),
new Length([
'min' => 8,
'minMessage' => 'Your password should be at least {{ limit }} characters',
// max length allowed by Symfony for security reasons
'max' => 4096,
]),
new NotBlank(message: 'Please enter a password'),
new Length(min: 8, max: 4096, minMessage: 'Your password should be at least {{ limit }} characters'),
],
'translation_domain' => false,
])

View File

@@ -31,13 +31,9 @@ class UploadQuizFormType extends AbstractType
'required' => true,
'translation_domain' => false,
'constraints' => [
new File([
'maxSize' => '1024k',
'mimeTypes' => [
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
],
'mimeTypesMessage' => $this->translator->trans('Please upload a valid XLSX file'),
]),
new File(maxSize: '1024k', mimeTypes: [
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
], mimeTypesMessage: $this->translator->trans('Please upload a valid XLSX file')),
],
])
;

View File

@@ -12,6 +12,7 @@ use App\Entity\Quiz;
use App\Entity\Season;
use App\Entity\User;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\Voter\Vote;
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
/** @extends Voter<string, Season> */
@@ -37,7 +38,7 @@ final class SeasonVoter extends Voter
}
/** @param Season|Elimination|Quiz|Candidate|Answer|Question $subject */
protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token): bool
protected function voteOnAttribute(string $attribute, mixed $subject, TokenInterface $token, ?Vote $vote = null): bool
{
$user = $token->getUser();
if (!$user instanceof User) {