mirror of
https://github.com/MarijnDoeve/TijdVoorDeTest.git
synced 2026-03-07 13:14:20 +01:00
Compare commits
8 Commits
6a77df402d
...
366bc36520
| Author | SHA1 | Date | |
|---|---|---|---|
|
366bc36520
|
|||
|
79b24b0d44
|
|||
|
7f93680987
|
|||
|
bdbff32256
|
|||
| ebadc24b59 | |||
| e0075fdcdc | |||
| 06aafefffc | |||
| ff6534fa81 |
2
.idea/TijdVoorDeTest.iml
generated
2
.idea/TijdVoorDeTest.iml
generated
@@ -134,7 +134,6 @@
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/browser-kit" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/dom-crawler" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/mailer" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php84" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfonycasts/verify-email-bundle" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/psr7" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/jean85/pretty-package-versions" />
|
||||
@@ -166,6 +165,7 @@
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/twig/intl-extra" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/stimulus-bundle" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/ux-turbo" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-uuid" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
|
||||
28
.idea/php.xml
generated
28
.idea/php.xml
generated
@@ -7,11 +7,6 @@
|
||||
</laravel_pint_by_interpreter>
|
||||
</laravel_pint_settings>
|
||||
</component>
|
||||
<component name="MessDetector">
|
||||
<phpmd_settings>
|
||||
<phpmd_by_interpreter asDefaultInterpreter="true" interpreter_id="96512cb2-7b9e-4e1d-bfa2-bf7f3be424c8" timeout="30000" />
|
||||
</phpmd_settings>
|
||||
</component>
|
||||
<component name="MessDetectorOptionsConfiguration">
|
||||
<option name="transferred" value="true" />
|
||||
</component>
|
||||
@@ -31,11 +26,6 @@
|
||||
<phpcs_fixer_by_interpreter asDefaultInterpreter="true" deletedFromTheList="true" interpreter_id="96512cb2-7b9e-4e1d-bfa2-bf7f3be424c8" standards="DoctrineAnnotation;PER;PER-CS;PER-CS1.0;PER-CS2.0;PHP54Migration;PHP56Migration;PHP70Migration;PHP71Migration;PHP73Migration;PHP74Migration;PHP80Migration;PHP81Migration;PHP82Migration;PHP83Migration;PHP84Migration;PHPUnit100Migration;PHPUnit30Migration;PHPUnit32Migration;PHPUnit35Migration;PHPUnit43Migration;PHPUnit48Migration;PHPUnit50Migration;PHPUnit52Migration;PHPUnit54Migration;PHPUnit55Migration;PHPUnit56Migration;PHPUnit57Migration;PHPUnit60Migration;PHPUnit75Migration;PHPUnit84Migration;PHPUnit91Migration;PSR1;PSR12;PSR2;PhpCsFixer;Symfony" tool_path="vendor/bin/php-cs-fixer" timeout="30000" />
|
||||
</phpcsfixer_settings>
|
||||
</component>
|
||||
<component name="PhpCodeSniffer">
|
||||
<phpcs_settings>
|
||||
<phpcs_by_interpreter asDefaultInterpreter="true" interpreter_id="96512cb2-7b9e-4e1d-bfa2-bf7f3be424c8" timeout="30000" />
|
||||
</phpcs_settings>
|
||||
</component>
|
||||
<component name="PhpExternalFormatter">
|
||||
<option name="externalFormatter" value="PHP_CS_FIXER" />
|
||||
</component>
|
||||
@@ -108,7 +98,6 @@
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/http-client" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/stopwatch" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/finder" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php84" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/yaml" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/mime" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/psr-http-message-bridge" />
|
||||
@@ -201,11 +190,13 @@
|
||||
<path value="$PROJECT_DIR$/vendor/twig/twig" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/ux-turbo" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/stimulus-bundle" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-uuid" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/polyfill-php84" />
|
||||
</include_path>
|
||||
</component>
|
||||
<component name="PhpInterpreters">
|
||||
<interpreters>
|
||||
<interpreter id="96512cb2-7b9e-4e1d-bfa2-bf7f3be424c8" name="Compose PHP 8.3" home="docker-compose://DATA" auto="false" debugger_id="php.debugger.XDebug">
|
||||
<interpreter id="96512cb2-7b9e-4e1d-bfa2-bf7f3be424c8" name="Compose PHP 8.4" home="docker-compose://DATA" auto="false" debugger_id="php.debugger.XDebug">
|
||||
<remote_data INTERPRETER_PATH="php" HELPERS_PATH="/opt/.phpstorm_helpers" VALID="true" RUN_AS_ROOT_VIA_SUDO="false" DOCKER_ACCOUNT_NAME="Colima" DOCKER_COMPOSE_SERVICE_NAME="php" DOCKER_REMOTE_PROJECT_PATH="/opt/project">
|
||||
<type_data command="EXEC" />
|
||||
<dockerComposeConfigurationPaths>
|
||||
@@ -219,15 +210,15 @@
|
||||
</component>
|
||||
<component name="PhpInterpretersPhpInfoCache">
|
||||
<phpInfoCache>
|
||||
<interpreter name="Compose PHP 8.3">
|
||||
<phpinfo binary_type="PHP" php_cgi="/usr/local/bin/php-cgi" php_cli="/usr/local/bin/php" path_separator=":" version="8.3.19">
|
||||
<additional_php_ini>/usr/local/etc/php/conf.d/docker-php-ext-apcu.ini, /usr/local/etc/php/conf.d/docker-php-ext-intl.ini, /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini, /usr/local/etc/php/conf.d/docker-php-ext-pdo_pgsql.ini, /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini, /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini, /usr/local/etc/php/conf.d/docker-php-ext-zip.ini, /usr/local/etc/php/app.conf.d/10-app.ini, /usr/local/etc/php/app.conf.d/20-app.dev.ini</additional_php_ini>
|
||||
<interpreter name="Compose PHP 8.4">
|
||||
<phpinfo binary_type="PHP" php_cgi="/usr/local/bin/php-cgi" php_cli="/usr/local/bin/php" path_separator=":" version="8.4.8">
|
||||
<additional_php_ini>/usr/local/etc/php/conf.d/docker-php-ext-apcu.ini, /usr/local/etc/php/conf.d/docker-php-ext-excimer.ini, /usr/local/etc/php/conf.d/docker-php-ext-gd.ini, /usr/local/etc/php/conf.d/docker-php-ext-intl.ini, /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini, /usr/local/etc/php/conf.d/docker-php-ext-pdo_pgsql.ini, /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini, /usr/local/etc/php/conf.d/docker-php-ext-uuid.ini, /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini, /usr/local/etc/php/conf.d/docker-php-ext-zip.ini, /usr/local/etc/php/app.conf.d/10-app.ini, /usr/local/etc/php/app.conf.d/20-app.dev.ini</additional_php_ini>
|
||||
<configuration_file>/usr/local/etc/php/php.ini</configuration_file>
|
||||
<configuration_options>
|
||||
<configuration_option name="include_path" value=".:/usr/local/lib/php" />
|
||||
</configuration_options>
|
||||
<debuggers>
|
||||
<debugger_info debugger="xdebug" debugger_version="3.4.2">
|
||||
<debugger_info debugger="xdebug" debugger_version="3.4.3">
|
||||
<debug_extensions />
|
||||
</debugger_info>
|
||||
</debuggers>
|
||||
@@ -244,8 +235,10 @@
|
||||
<extension name="curl" />
|
||||
<extension name="date" />
|
||||
<extension name="dom" />
|
||||
<extension name="excimer" />
|
||||
<extension name="fileinfo" />
|
||||
<extension name="filter" />
|
||||
<extension name="gd" />
|
||||
<extension name="hash" />
|
||||
<extension name="iconv" />
|
||||
<extension name="intl" />
|
||||
@@ -265,6 +258,7 @@
|
||||
<extension name="sqlite3" />
|
||||
<extension name="standard" />
|
||||
<extension name="tokenizer" />
|
||||
<extension name="uuid" />
|
||||
<extension name="xdebug" />
|
||||
<extension name="xml" />
|
||||
<extension name="xmlreader" />
|
||||
@@ -276,7 +270,7 @@
|
||||
</interpreter>
|
||||
</phpInfoCache>
|
||||
</component>
|
||||
<component name="PhpProjectSharedConfiguration" php_language_level="8.3" />
|
||||
<component name="PhpProjectSharedConfiguration" php_language_level="8.4" />
|
||||
<component name="PhpStan">
|
||||
<PhpStan_settings>
|
||||
<phpstan_by_interpreter interpreter_id="96512cb2-7b9e-4e1d-bfa2-bf7f3be424c8" tool_path="vendor/bin/phpstan" timeout="60000" />
|
||||
|
||||
1
.idea/symfony2.xml
generated
1
.idea/symfony2.xml
generated
@@ -2,5 +2,6 @@
|
||||
<project version="4">
|
||||
<component name="Symfony2PluginSettings">
|
||||
<option name="pluginEnabled" value="true" />
|
||||
<option name="profilerCsvPath" value="" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,7 +1,7 @@
|
||||
#syntax=docker/dockerfile:1
|
||||
|
||||
# Versions
|
||||
FROM dunglas/frankenphp:1-php8.3 AS frankenphp_upstream
|
||||
FROM dunglas/frankenphp:1-php8.4 AS frankenphp_upstream
|
||||
|
||||
# The different stages of this Dockerfile are meant to be built into separate images
|
||||
# https://docs.docker.com/develop/develop-images/multistage-build/#stop-at-a-specific-build-stage
|
||||
@@ -31,7 +31,6 @@ RUN set -eux; \
|
||||
intl \
|
||||
opcache \
|
||||
zip \
|
||||
uuid \
|
||||
gd \
|
||||
excimer-1.2.3 \
|
||||
;
|
||||
|
||||
@@ -15,6 +15,7 @@ services:
|
||||
# See https://xdebug.org/docs/all_settings#mode
|
||||
XDEBUG_MODE: "${XDEBUG_MODE:-off}"
|
||||
MAILER_DSN: "smtp://mailer:1025"
|
||||
PHP_CS_FIXER_IGNORE_ENV: 1
|
||||
extra_hosts:
|
||||
# Ensure that host.docker.internal is correctly defined on Linux
|
||||
- host.docker.internal:host-gateway
|
||||
|
||||
@@ -8,6 +8,7 @@ services:
|
||||
APP_SECRET: ${APP_SECRET}
|
||||
MERCURE_PUBLISHER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET}
|
||||
MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET}
|
||||
MAILER_DSN: ${MAILER_DSN}
|
||||
MAILER_SENDER: ${MAILER_SENDER}
|
||||
SENTRY_DSN: ${SENTRY_DSN}
|
||||
labels:
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true,
|
||||
"require": {
|
||||
"php": ">=8.3.15",
|
||||
"php": ">=8.4",
|
||||
"ext-ctype": "*",
|
||||
"ext-iconv": "*",
|
||||
"doctrine/dbal": "^4.2.3",
|
||||
@@ -15,28 +15,28 @@
|
||||
"doctrine/orm": "^3.3.3",
|
||||
"easycorp/easyadmin-bundle": "^4.24.7",
|
||||
"phpdocumentor/reflection-docblock": "^5.6.2",
|
||||
"phpoffice/phpspreadsheet": "^4.2.0",
|
||||
"phpoffice/phpspreadsheet": "^4.3.1",
|
||||
"phpstan/phpdoc-parser": "^2.1",
|
||||
"runtime/frankenphp-symfony": "^0.2.0",
|
||||
"sentry/sentry-symfony": "^5.2",
|
||||
"symfony/asset": "7.2.*",
|
||||
"symfony/asset-mapper": "7.2.*",
|
||||
"symfony/console": "7.2.*",
|
||||
"symfony/dotenv": "7.2.*",
|
||||
"symfony/flex": "^2.7.0",
|
||||
"symfony/form": "7.2.*",
|
||||
"symfony/framework-bundle": "7.2.*",
|
||||
"symfony/mailer": "7.2.*",
|
||||
"symfony/property-access": "7.2.*",
|
||||
"symfony/property-info": "7.2.*",
|
||||
"symfony/runtime": "7.2.*",
|
||||
"symfony/security-bundle": "7.2.*",
|
||||
"symfony/security-csrf": "7.2.*",
|
||||
"symfony/serializer": "7.2.*",
|
||||
"symfony/twig-bundle": "7.2.*",
|
||||
"symfony/uid": "7.2.*",
|
||||
"symfony/ux-turbo": "^2.26",
|
||||
"symfony/yaml": "7.2.*",
|
||||
"symfony/asset": "7.3.*",
|
||||
"symfony/asset-mapper": "7.3.*",
|
||||
"symfony/console": "7.3.*",
|
||||
"symfony/dotenv": "7.3.*",
|
||||
"symfony/flex": "^2.7.1",
|
||||
"symfony/form": "7.3.*",
|
||||
"symfony/framework-bundle": "7.3.*",
|
||||
"symfony/mailer": "7.3.*",
|
||||
"symfony/property-access": "7.3.*",
|
||||
"symfony/property-info": "7.3.*",
|
||||
"symfony/runtime": "7.3.*",
|
||||
"symfony/security-bundle": "7.3.*",
|
||||
"symfony/security-csrf": "7.3.*",
|
||||
"symfony/serializer": "7.3.*",
|
||||
"symfony/twig-bundle": "7.3.*",
|
||||
"symfony/uid": "7.3.*",
|
||||
"symfony/ux-turbo": "^2.26.1",
|
||||
"symfony/yaml": "7.3.*",
|
||||
"symfonycasts/sass-bundle": "^0.8.2",
|
||||
"symfonycasts/verify-email-bundle": "^1.17.3",
|
||||
"thecodingmachine/safe": "^3.3.0",
|
||||
@@ -52,15 +52,15 @@
|
||||
"phpstan/phpstan-doctrine": "^2.0.3",
|
||||
"phpstan/phpstan-phpunit": "^2.0.6",
|
||||
"phpstan/phpstan-symfony": "^2.0.6",
|
||||
"phpunit/phpunit": "^12.1.6",
|
||||
"rector/rector": "^2.0.16",
|
||||
"phpunit/phpunit": "^12.2.1",
|
||||
"rector/rector": "^2.0.17",
|
||||
"roave/security-advisories": "dev-latest",
|
||||
"symfony/browser-kit": "7.2.*",
|
||||
"symfony/css-selector": "7.2.*",
|
||||
"symfony/browser-kit": "7.3.*",
|
||||
"symfony/css-selector": "7.3.*",
|
||||
"symfony/maker-bundle": "^1.63.0",
|
||||
"symfony/phpunit-bridge": "7.2.*",
|
||||
"symfony/stopwatch": "7.2.*",
|
||||
"symfony/web-profiler-bundle": "7.2.*",
|
||||
"symfony/phpunit-bridge": "7.3.*",
|
||||
"symfony/stopwatch": "7.3.*",
|
||||
"symfony/web-profiler-bundle": "7.3.*",
|
||||
"thecodingmachine/phpstan-safe-rule": "^1.4.1",
|
||||
"vincentlanglet/twig-cs-fixer": "^3.7.1"
|
||||
},
|
||||
@@ -95,7 +95,7 @@
|
||||
"symfony/polyfill-php81": "*",
|
||||
"symfony/polyfill-php82": "*",
|
||||
"symfony/polyfill-php83": "*",
|
||||
"symfony/polyfill-uuid": "*"
|
||||
"symfony/polyfill-php84": "*"
|
||||
},
|
||||
"scripts": {
|
||||
"auto-scripts": {
|
||||
@@ -116,7 +116,7 @@
|
||||
"extra": {
|
||||
"symfony": {
|
||||
"allow-contrib": false,
|
||||
"require": "7.2.*",
|
||||
"require": "7.3.*",
|
||||
"docker": true
|
||||
}
|
||||
}
|
||||
|
||||
870
composer.lock
generated
870
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -24,6 +24,8 @@ doctrine:
|
||||
dir: '%kernel.project_dir%/src/Entity'
|
||||
prefix: 'App\Entity'
|
||||
alias: App
|
||||
controller_resolver:
|
||||
auto_mapping: false
|
||||
|
||||
when@test:
|
||||
doctrine:
|
||||
|
||||
3
config/packages/property_info.yaml
Normal file
3
config/packages/property_info.yaml
Normal file
@@ -0,0 +1,3 @@
|
||||
framework:
|
||||
property_info:
|
||||
with_constructor_extractor: true
|
||||
@@ -1,4 +1,4 @@
|
||||
when@dev:
|
||||
_errors:
|
||||
resource: '@FrameworkBundle/Resources/config/routing/errors.xml'
|
||||
resource: '@FrameworkBundle/Resources/config/routing/errors.php'
|
||||
prefix: /_error
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
when@dev:
|
||||
web_profiler_wdt:
|
||||
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
|
||||
resource: '@WebProfilerBundle/Resources/config/routing/wdt.php'
|
||||
prefix: /_wdt
|
||||
|
||||
web_profiler_profiler:
|
||||
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
|
||||
resource: '@WebProfilerBundle/Resources/config/routing/profiler.php'
|
||||
prefix: /_profiler
|
||||
|
||||
@@ -27,7 +27,6 @@ return RectorConfig::configure()
|
||||
phpunitCodeQuality: true,
|
||||
doctrineCodeQuality: true,
|
||||
symfonyCodeQuality: true,
|
||||
// naming: true
|
||||
)
|
||||
->withAttributesSets(all: true)
|
||||
->withComposerBased(twig: true, doctrine: true, phpunit: true, symfony: true)
|
||||
|
||||
@@ -7,9 +7,9 @@ namespace App\Command;
|
||||
use App\Repository\SeasonRepository;
|
||||
use App\Repository\UserRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Component\Console\Attribute\Argument;
|
||||
use Symfony\Component\Console\Attribute\AsCommand;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
@@ -18,29 +18,19 @@ use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
name: 'app:claim-season',
|
||||
description: 'Give a user owner rights on a season',
|
||||
)]
|
||||
class ClaimSeasonCommand extends Command
|
||||
readonly class ClaimSeasonCommand
|
||||
{
|
||||
public function __construct(
|
||||
private readonly UserRepository $userRepository,
|
||||
private readonly SeasonRepository $seasonRepository,
|
||||
private readonly EntityManagerInterface $entityManager)
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
public function __construct(private UserRepository $userRepository, private SeasonRepository $seasonRepository, private EntityManagerInterface $entityManager) {}
|
||||
|
||||
protected function configure(): void
|
||||
{
|
||||
$this
|
||||
->addArgument('email', InputArgument::REQUIRED, 'The email of the user thats claims the season')
|
||||
->addArgument('season', InputArgument::REQUIRED, 'The season to claim')
|
||||
;
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
public function __invoke(
|
||||
#[Argument]
|
||||
string $seasonCode,
|
||||
#[Argument]
|
||||
string $email,
|
||||
InputInterface $input,
|
||||
OutputInterface $output,
|
||||
): int {
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
$email = $input->getArgument('email');
|
||||
$seasonCode = $input->getArgument('season');
|
||||
|
||||
try {
|
||||
$season = $this->seasonRepository->findOneBy(['seasonCode' => $seasonCode]);
|
||||
|
||||
@@ -5,9 +5,9 @@ declare(strict_types=1);
|
||||
namespace App\Command;
|
||||
|
||||
use App\Repository\UserRepository;
|
||||
use Symfony\Component\Console\Attribute\Argument;
|
||||
use Symfony\Component\Console\Attribute\AsCommand;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
@@ -16,25 +16,17 @@ use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
name: 'app:make-admin',
|
||||
description: 'Give a user the role admin',
|
||||
)]
|
||||
class MakeAdminCommand extends Command
|
||||
readonly class MakeAdminCommand
|
||||
{
|
||||
public function __construct(private readonly UserRepository $userRepository)
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
public function __construct(private UserRepository $userRepository) {}
|
||||
|
||||
protected function configure(): void
|
||||
{
|
||||
$this
|
||||
->addArgument('email', InputArgument::REQUIRED, 'The email of the user to make admin')
|
||||
;
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
public function __invoke(
|
||||
#[Argument]
|
||||
string $email,
|
||||
InputInterface $input,
|
||||
OutputInterface $output,
|
||||
): int {
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
$email = $input->getArgument('email');
|
||||
|
||||
try {
|
||||
$this->userRepository->makeAdmin($email);
|
||||
} catch (\InvalidArgumentException) {
|
||||
|
||||
@@ -43,7 +43,7 @@ final class BackofficeController extends AbstractController
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/backoffice/add', name: 'app_backoffice_season_add', priority: 10)]
|
||||
#[Route('/backoffice/season/add', name: 'app_backoffice_season_add', priority: 10)]
|
||||
public function addSeason(Request $request, EntityManagerInterface $em): Response
|
||||
{
|
||||
$season = new Season();
|
||||
|
||||
@@ -13,13 +13,14 @@ use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Routing\Requirement\Requirement;
|
||||
|
||||
final class PrepareEliminationController extends AbstractController
|
||||
{
|
||||
#[Route(
|
||||
'/backoffice/elimination/{seasonCode}/{quiz}/prepare',
|
||||
'/backoffice/season/{seasonCode:season}/quiz/{quiz}/elimination/prepare',
|
||||
name: 'app_prepare_elimination',
|
||||
requirements: ['seasonCode' => self::SEASON_CODE_REGEX],
|
||||
requirements: ['seasonCode' => self::SEASON_CODE_REGEX, 'quiz' => Requirement::UUID],
|
||||
)]
|
||||
public function index(Season $season, Quiz $quiz, EliminationFactory $eliminationFactory): Response
|
||||
{
|
||||
@@ -31,7 +32,7 @@ final class PrepareEliminationController extends AbstractController
|
||||
#[Route(
|
||||
'/backoffice/elimination/{elimination}',
|
||||
name: 'app_prepare_elimination_view',
|
||||
requirements: ['seasonCode' => self::SEASON_CODE_REGEX],
|
||||
requirements: ['elimination' => Requirement::UUID],
|
||||
)]
|
||||
public function viewElimination(Elimination $elimination, Request $request, EntityManagerInterface $em): Response
|
||||
{
|
||||
|
||||
@@ -20,6 +20,7 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Attribute\AsController;
|
||||
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Routing\Requirement\Requirement;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
@@ -33,9 +34,9 @@ class QuizController extends AbstractController
|
||||
) {}
|
||||
|
||||
#[Route(
|
||||
'/backoffice/season/{seasonCode}/quiz/{quiz}',
|
||||
'/backoffice/season/{seasonCode:season}/quiz/{quiz}',
|
||||
name: 'app_backoffice_quiz',
|
||||
requirements: ['seasonCode' => self::SEASON_CODE_REGEX],
|
||||
requirements: ['seasonCode' => self::SEASON_CODE_REGEX, 'quiz' => Requirement::UUID],
|
||||
)]
|
||||
#[IsGranted(SeasonVoter::EDIT, subject: 'season')]
|
||||
public function index(Season $season, Quiz $quiz): Response
|
||||
@@ -48,9 +49,9 @@ class QuizController extends AbstractController
|
||||
}
|
||||
|
||||
#[Route(
|
||||
'/backoffice/season/{seasonCode}/quiz/{quiz}/enable',
|
||||
'/backoffice/season/{seasonCode:season}/quiz/{quiz}/enable',
|
||||
name: 'app_backoffice_enable',
|
||||
requirements: ['seasonCode' => self::SEASON_CODE_REGEX],
|
||||
requirements: ['seasonCode' => self::SEASON_CODE_REGEX, 'quiz' => Requirement::UUID],
|
||||
)]
|
||||
#[IsGranted(SeasonVoter::EDIT, subject: 'season')]
|
||||
public function enableQuiz(Season $season, ?Quiz $quiz, EntityManagerInterface $em): RedirectResponse
|
||||
@@ -68,6 +69,7 @@ class QuizController extends AbstractController
|
||||
#[Route(
|
||||
'/backoffice/quiz/{quiz}/clear',
|
||||
name: 'app_backoffice_quiz_clear',
|
||||
requirements: ['quiz' => Requirement::UUID],
|
||||
)]
|
||||
#[IsGranted(SeasonVoter::EDIT, subject: 'quiz')]
|
||||
public function clearQuiz(Quiz $quiz, QuizRepository $quizRepository): RedirectResponse
|
||||
@@ -85,6 +87,7 @@ class QuizController extends AbstractController
|
||||
#[Route(
|
||||
'/backoffice/quiz/{quiz}/delete',
|
||||
name: 'app_backoffice_quiz_delete',
|
||||
requirements: ['quiz' => Requirement::UUID],
|
||||
)]
|
||||
#[IsGranted(SeasonVoter::DELETE, subject: 'quiz')]
|
||||
public function deleteQuiz(Quiz $quiz, QuizRepository $quizRepository): RedirectResponse
|
||||
@@ -97,8 +100,9 @@ class QuizController extends AbstractController
|
||||
}
|
||||
|
||||
#[Route(
|
||||
'/backoffice/quiz/{quiz}/modify_correction/{candidate}',
|
||||
'/backoffice/quiz/{quiz}/candidate/{candidate}/modify_correction',
|
||||
name: 'app_backoffice_modify_correction',
|
||||
requirements: ['quiz' => Requirement::UUID, 'candidate' => Requirement::UUID],
|
||||
)]
|
||||
#[IsGranted(SeasonVoter::EDIT, subject: 'quiz')]
|
||||
public function modifyCorrection(Quiz $quiz, Candidate $candidate, QuizCandidateRepository $quizCandidateRepository, Request $request): RedirectResponse
|
||||
|
||||
@@ -30,7 +30,7 @@ class SeasonController extends AbstractController
|
||||
) {}
|
||||
|
||||
#[Route(
|
||||
'/backoffice/season/{seasonCode}',
|
||||
'/backoffice/season/{seasonCode:season}',
|
||||
name: 'app_backoffice_season',
|
||||
requirements: ['seasonCode' => self::SEASON_CODE_REGEX],
|
||||
)]
|
||||
@@ -43,7 +43,7 @@ class SeasonController extends AbstractController
|
||||
}
|
||||
|
||||
#[Route(
|
||||
'/backoffice/season/{seasonCode}/add_candidate',
|
||||
'/backoffice/season/{seasonCode:season}/add-candidate',
|
||||
name: 'app_backoffice_add_candidates',
|
||||
requirements: ['seasonCode' => self::SEASON_CODE_REGEX],
|
||||
priority: 10,
|
||||
@@ -56,7 +56,7 @@ class SeasonController extends AbstractController
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$candidates = $form->get('candidates')->getData();
|
||||
foreach (explode("\r\n", (string) $candidates) as $candidate) {
|
||||
foreach (explode("\n", (string) $candidates) as $candidate) {
|
||||
$season->addCandidate(new Candidate($candidate));
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ class SeasonController extends AbstractController
|
||||
}
|
||||
|
||||
#[Route(
|
||||
'/backoffice/season/{seasonCode}/add',
|
||||
'/backoffice/season/{seasonCode:season}/add-quiz',
|
||||
name: 'app_backoffice_quiz_add',
|
||||
requirements: ['seasonCode' => self::SEASON_CODE_REGEX],
|
||||
priority: 10,
|
||||
|
||||
@@ -16,6 +16,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Attribute\AsController;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Routing\Requirement\Requirement;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
@@ -27,7 +28,7 @@ final class EliminationController extends AbstractController
|
||||
{
|
||||
public function __construct(private readonly TranslatorInterface $translator) {}
|
||||
|
||||
#[Route('/elimination/{elimination}', name: 'app_elimination')]
|
||||
#[Route('/elimination/{elimination}', name: 'app_elimination', requirements: ['elimination' => Requirement::UUID])]
|
||||
#[IsGranted(SeasonVoter::ELIMINATION, 'elimination')]
|
||||
public function index(#[MapEntity] Elimination $elimination, Request $request): Response
|
||||
{
|
||||
@@ -47,7 +48,7 @@ final class EliminationController extends AbstractController
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/elimination/{elimination}/{candidateHash}', name: 'app_elimination_candidate')]
|
||||
#[Route('/elimination/{elimination}/{candidateHash}', name: 'app_elimination_candidate', requirements: ['elimination' => Requirement::UUID, 'candidateHash' => self::CANDIDATE_HASH_REGEX])]
|
||||
#[IsGranted(SeasonVoter::ELIMINATION, 'elimination')]
|
||||
public function candidateScreen(Elimination $elimination, string $candidateHash, CandidateRepository $candidateRepository): Response
|
||||
{
|
||||
|
||||
@@ -20,7 +20,6 @@ use App\Repository\GivenAnswerRepository;
|
||||
use App\Repository\QuestionRepository;
|
||||
use App\Repository\QuizCandidateRepository;
|
||||
use App\Repository\SeasonRepository;
|
||||
use Symfony\Bridge\Doctrine\Attribute\MapEntity;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Attribute\AsController;
|
||||
@@ -54,10 +53,9 @@ final class QuizController extends AbstractController
|
||||
return $this->render('quiz/select_season.html.twig', ['form' => $form]);
|
||||
}
|
||||
|
||||
#[Route(path: '/{seasonCode}', name: 'app_quiz_enter_name', requirements: ['seasonCode' => self::SEASON_CODE_REGEX])]
|
||||
#[Route(path: '/{seasonCode:season}', name: 'app_quiz_enter_name', requirements: ['seasonCode' => self::SEASON_CODE_REGEX])]
|
||||
public function enterName(
|
||||
Request $request,
|
||||
#[MapEntity(mapping: ['seasonCode' => 'seasonCode'])]
|
||||
Season $season,
|
||||
): Response {
|
||||
$form = $this->createForm(EnterNameType::class);
|
||||
@@ -74,12 +72,11 @@ final class QuizController extends AbstractController
|
||||
}
|
||||
|
||||
#[Route(
|
||||
path: '/{seasonCode}/{nameHash}',
|
||||
path: '/{seasonCode:season}/{nameHash}',
|
||||
name: 'app_quiz_quiz_page',
|
||||
requirements: ['seasonCode' => self::SEASON_CODE_REGEX, 'nameHash' => self::CANDIDATE_HASH_REGEX],
|
||||
)]
|
||||
public function quizPage(
|
||||
#[MapEntity(mapping: ['seasonCode' => 'seasonCode'])]
|
||||
Season $season,
|
||||
string $nameHash,
|
||||
Request $request,
|
||||
|
||||
@@ -9,11 +9,13 @@ use App\Form\RegistrationFormType;
|
||||
use App\Repository\UserRepository;
|
||||
use App\Security\EmailVerifier;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Bundle\SecurityBundle\Security;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Mailer\Exception\TransportExceptionInterface;
|
||||
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
@@ -29,6 +31,7 @@ final class RegistrationController extends AbstractController
|
||||
UserPasswordHasherInterface $userPasswordHasher,
|
||||
Security $security,
|
||||
EntityManagerInterface $entityManager,
|
||||
LoggerInterface $logger,
|
||||
): Response {
|
||||
$user = new User();
|
||||
$form = $this->createForm(RegistrationFormType::class, $user);
|
||||
@@ -43,14 +46,17 @@ final class RegistrationController extends AbstractController
|
||||
$entityManager->persist($user);
|
||||
$entityManager->flush();
|
||||
|
||||
try {
|
||||
// generate a signed url and email it to the user
|
||||
$this->emailVerifier->sendEmailConfirmation('app_verify_email', $user,
|
||||
(new TemplatedEmail())
|
||||
new TemplatedEmail()
|
||||
->to((string) $user->getEmail())
|
||||
->subject($this->translator->trans('Please Confirm your Email'))
|
||||
->htmlTemplate('backoffice/registration/confirmation_email.html.twig'),
|
||||
);
|
||||
|
||||
} catch (TransportExceptionInterface $e) {
|
||||
$logger->error($e->getMessage());
|
||||
}
|
||||
$response = $security->login($user, 'form_login', 'main');
|
||||
\assert($response instanceof Response);
|
||||
|
||||
|
||||
@@ -44,18 +44,18 @@ class KrtekFixtures extends Fixture
|
||||
|
||||
private function createQuiz1(Season $season): Quiz
|
||||
{
|
||||
return (new Quiz())
|
||||
return new Quiz()
|
||||
->setName('Quiz 1')
|
||||
->setSeason($season)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Is de Krtek een man of een vrouw?')
|
||||
->addAnswer(new Answer('Vrouw', true))
|
||||
->addAnswer(new Answer('Man'))
|
||||
->setOrdering(1),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Hoeveel broers heeft de Krtek?')
|
||||
->addAnswer(new Answer('Geen', true))
|
||||
->addAnswer(new Answer('1'))
|
||||
@@ -63,7 +63,7 @@ class KrtekFixtures extends Fixture
|
||||
->setOrdering(2),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Wat is de lievelingsfeestdag van de Krtek?')
|
||||
->addAnswer(new Answer('Geen'))
|
||||
->addAnswer(new Answer('Diens eigen verjaardag'))
|
||||
@@ -73,13 +73,13 @@ class KrtekFixtures extends Fixture
|
||||
->setOrdering(3),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Hoe kwam de Krtek naar Kersteren vandaag?')
|
||||
->addAnswer(new Answer('Met het OV', true))
|
||||
->addAnswer(new Answer('Met de auto'))
|
||||
->setOrdering(4),
|
||||
)
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Met wie keek de Krtek video bij binnenkomst?')
|
||||
->addAnswer(new Answer('Claudia'))
|
||||
->addAnswer(new Answer('Eelco'))
|
||||
@@ -97,7 +97,7 @@ class KrtekFixtures extends Fixture
|
||||
->setOrdering(5),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Welk advies zou de Krtek zichzelf als kind geven?')
|
||||
->addAnswer(new Answer('Geef je vader een knuffel.'))
|
||||
->addAnswer(new Answer('Trek je wat minder aan van anderen.'))
|
||||
@@ -110,7 +110,7 @@ class KrtekFixtures extends Fixture
|
||||
->setOrdering(6),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Wat voor soort schoenen droeg de Krtek bij het diner?')
|
||||
->addAnswer(new Answer('Sneakers'))
|
||||
->addAnswer(new Answer('Wandel-/bergschoenen', true))
|
||||
@@ -121,7 +121,7 @@ class KrtekFixtures extends Fixture
|
||||
->setOrdering(7),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Met welk vervoersmiddel reist de Krtek het liefste?')
|
||||
->addAnswer(new Answer('Fiets', true))
|
||||
->addAnswer(new Answer('Auto'))
|
||||
@@ -129,14 +129,14 @@ class KrtekFixtures extends Fixture
|
||||
->setOrdering(8),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Heeft de Krtek een eigen auto?')
|
||||
->addAnswer(new Answer('Ja'))
|
||||
->addAnswer(new Answer('Nee', true))
|
||||
->setOrdering(9),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Van wie is de quote die de Krtek gepakt heeft')
|
||||
->addAnswer(new Answer('Karen'))
|
||||
->addAnswer(new Answer('Gilles de Coster'))
|
||||
@@ -156,14 +156,14 @@ class KrtekFixtures extends Fixture
|
||||
->setOrdering(10),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Zou de Krtek molboekjes, jokers, vrijstellingen of topito’s uit iemands rugzak stelen om te kunnen winnen?')
|
||||
->addAnswer(new Answer('Ja'))
|
||||
->addAnswer(new Answer('Nee', true))
|
||||
->setOrdering(11),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('In wat voor bed slaapt de Krtek dit weekend?')
|
||||
->addAnswer(new Answer('Éénpersoons, losstaand bed'))
|
||||
->addAnswer(new Answer('Éénpersoonsbed, tegen een ander bed aan', true))
|
||||
@@ -171,7 +171,7 @@ class KrtekFixtures extends Fixture
|
||||
->setOrdering(12),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Hoeveel jaar heeft de Krtek gedaan over de middelbare school?')
|
||||
->addAnswer(new Answer('5'))
|
||||
->addAnswer(new Answer('6', true))
|
||||
@@ -180,14 +180,14 @@ class KrtekFixtures extends Fixture
|
||||
->setOrdering(13),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Waar zat de Krtek aan tafel bij het diner?')
|
||||
->addAnswer(new Answer('Met de rug naar de accommodatie'))
|
||||
->addAnswer(new Answer('Met de rug naar de buitenmuur', true))
|
||||
->setOrdering(14),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Wie is de Krtek?')
|
||||
->addAnswer(new Answer('Claudia', true))
|
||||
->addAnswer(new Answer('Eelco'))
|
||||
@@ -209,18 +209,18 @@ class KrtekFixtures extends Fixture
|
||||
|
||||
private function createQuiz2(Season $season): Quiz
|
||||
{
|
||||
return (new Quiz())
|
||||
return new Quiz()
|
||||
->setName('Quiz 2')
|
||||
->setSeason($season)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Is de Krtek een man of een vrouw?')
|
||||
->addAnswer(new Answer('Man'))
|
||||
->addAnswer(new Answer('Vrouw', true))
|
||||
->setOrdering(1),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Heeft de Krtek dieetwensen of allergieën?')
|
||||
->addAnswer(new Answer('nee'))
|
||||
->addAnswer(new Answer('De Krtek is vegetariër', true))
|
||||
@@ -232,7 +232,7 @@ class KrtekFixtures extends Fixture
|
||||
->setOrdering(2),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Hoe heet het huisdier/de huisdieren van de Krtek?')
|
||||
->addAnswer(new Answer('Amy, Karel en Floyd'))
|
||||
->addAnswer(new Answer('Flip en Majoor'))
|
||||
@@ -244,7 +244,7 @@ class KrtekFixtures extends Fixture
|
||||
->setOrdering(3),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Wat dronk de Krtek deze ochtend bij het ontbijt?')
|
||||
->addAnswer(new Answer('Koffie'))
|
||||
->addAnswer(new Answer('Thee'))
|
||||
@@ -255,7 +255,7 @@ class KrtekFixtures extends Fixture
|
||||
->setOrdering(4),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Waar ging de eerste vakantie die de Krtek zich nog herinnert heen?')
|
||||
->addAnswer(new Answer('Denemarken'))
|
||||
->addAnswer(new Answer('Drenthe'))
|
||||
@@ -267,7 +267,7 @@ class KrtekFixtures extends Fixture
|
||||
->setOrdering(5),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Met welk groepje ging de Krtek als eerste het Douanespel in?')
|
||||
->addAnswer(new Answer('Het eerste groepje', true))
|
||||
->addAnswer(new Answer('Het tweede groepje'))
|
||||
@@ -277,7 +277,7 @@ class KrtekFixtures extends Fixture
|
||||
->setOrdering(6),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Gelooft de Krtek ergens in?')
|
||||
->addAnswer(new Answer('Nee'))
|
||||
->addAnswer(new Answer('Het universum', true))
|
||||
@@ -286,14 +286,14 @@ class KrtekFixtures extends Fixture
|
||||
->setOrdering(7),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('At de Krtek op vrijdagavond heksenkaas tijdens het diner?')
|
||||
->addAnswer(new Answer('Ja', true))
|
||||
->addAnswer(new Answer('Nee'))
|
||||
->setOrdering(8),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Hoe laat ging de Krtek gisteravond naar bed?')
|
||||
->addAnswer(new Answer('Tussen 0:00 en 0:59 uur'))
|
||||
->addAnswer(new Answer('Tussen 1:00 en 1:59 uur', true))
|
||||
@@ -302,7 +302,7 @@ class KrtekFixtures extends Fixture
|
||||
->setOrdering(9),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Hoeveel batterijen heeft de Krtek naar het bord gebracht bij het douanespel?')
|
||||
->addAnswer(new Answer('1'))
|
||||
->addAnswer(new Answer('2'))
|
||||
@@ -311,7 +311,7 @@ class KrtekFixtures extends Fixture
|
||||
->setOrdering(10),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Wat keek de Krtek als kind graag op TV?')
|
||||
->addAnswer(new Answer('Digimon', true))
|
||||
->addAnswer(new Answer('Floris'))
|
||||
@@ -322,7 +322,7 @@ class KrtekFixtures extends Fixture
|
||||
->setOrdering(11),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Waarin zat op de heenreis de bagage van de Krtek (voornamelijk)?')
|
||||
->addAnswer(new Answer('In koffer(s)', true))
|
||||
->addAnswer(new Answer('In losse tas(sen)'))
|
||||
@@ -330,7 +330,7 @@ class KrtekFixtures extends Fixture
|
||||
->setOrdering(12),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Van welk geluid gaan de haren van de Krtek overeind staan?')
|
||||
->addAnswer(new Answer('Een vork die door een metalen pan krast '))
|
||||
->addAnswer(new Answer('Smakkende mensen'))
|
||||
@@ -343,14 +343,14 @@ class KrtekFixtures extends Fixture
|
||||
->setOrdering(13),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Wilde de Krtek penningmeester worden?')
|
||||
->addAnswer(new Answer('Ja'))
|
||||
->addAnswer(new Answer('Nee', true))
|
||||
->setOrdering(14),
|
||||
)
|
||||
|
||||
->addQuestion((new Question())
|
||||
->addQuestion(new Question()
|
||||
->setQuestion('Wie is de Krtek?')
|
||||
->addAnswer(new Answer('Claudia', true))
|
||||
->addAnswer(new Answer('Eelco'))
|
||||
|
||||
@@ -10,7 +10,7 @@ class Base64
|
||||
{
|
||||
public static function base64UrlEncode(string $input): string
|
||||
{
|
||||
return rtrim(strtr(base64_encode($input), '+/', '-_'), '=');
|
||||
return mb_rtrim(strtr(base64_encode($input), '+/', '-_'), '=');
|
||||
}
|
||||
|
||||
/** @throws UrlException */
|
||||
|
||||
@@ -8,18 +8,19 @@ use App\Entity\User;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bridge\Twig\Mime\TemplatedEmail;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Mailer\Exception\TransportExceptionInterface;
|
||||
use Symfony\Component\Mailer\MailerInterface;
|
||||
use SymfonyCasts\Bundle\VerifyEmail\Exception\VerifyEmailExceptionInterface;
|
||||
use SymfonyCasts\Bundle\VerifyEmail\VerifyEmailHelperInterface;
|
||||
|
||||
class EmailVerifier
|
||||
readonly class EmailVerifier
|
||||
{
|
||||
public function __construct(
|
||||
private readonly VerifyEmailHelperInterface $verifyEmailHelper,
|
||||
private readonly MailerInterface $mailer,
|
||||
private readonly EntityManagerInterface $entityManager,
|
||||
private VerifyEmailHelperInterface $verifyEmailHelper,
|
||||
private MailerInterface $mailer,
|
||||
private EntityManagerInterface $entityManager,
|
||||
) {}
|
||||
|
||||
/** @throws TransportExceptionInterface */
|
||||
public function sendEmailConfirmation(string $verifyEmailRouteName, User $user, TemplatedEmail $email): void
|
||||
{
|
||||
$signatureComponents = $this->verifyEmailHelper->generateSignature(
|
||||
@@ -39,7 +40,6 @@ class EmailVerifier
|
||||
$this->mailer->send($email);
|
||||
}
|
||||
|
||||
/** @throws VerifyEmailExceptionInterface */
|
||||
public function handleEmailConfirmation(Request $request, User $user): void
|
||||
{
|
||||
$this->verifyEmailHelper->validateEmailConfirmationFromRequest($request, (string) $user->getId(), (string) $user->getEmail());
|
||||
|
||||
@@ -8,8 +8,9 @@ use App\Entity\Answer;
|
||||
use App\Entity\Question;
|
||||
use App\Entity\Quiz;
|
||||
use App\Exception\SpreadsheetDataException;
|
||||
use PhpOffice\PhpSpreadsheet\Reader;
|
||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||
use PhpOffice\PhpSpreadsheet\Writer;
|
||||
use Symfony\Component\HttpFoundation\File\File;
|
||||
|
||||
class QuizSpreadsheetService
|
||||
@@ -64,7 +65,7 @@ class QuizSpreadsheetService
|
||||
|
||||
private function readSheet(File $file): Spreadsheet
|
||||
{
|
||||
return (new \PhpOffice\PhpSpreadsheet\Reader\Xlsx())->setReadDataOnly(true)->load($file->getRealPath());
|
||||
return new Reader\Xlsx()->setReadDataOnly(true)->load($file->getRealPath());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -117,7 +118,7 @@ class QuizSpreadsheetService
|
||||
|
||||
private function toXlsx(Spreadsheet $spreadsheet): \Closure
|
||||
{
|
||||
$writer = new Xlsx($spreadsheet);
|
||||
$writer = new Writer\Xlsx($spreadsheet);
|
||||
|
||||
return static fn () => $writer->save('php://output');
|
||||
}
|
||||
|
||||
12
symfony.lock
12
symfony.lock
@@ -213,6 +213,18 @@
|
||||
"tests/bootstrap.php"
|
||||
]
|
||||
},
|
||||
"symfony/property-info": {
|
||||
"version": "7.3",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes",
|
||||
"branch": "main",
|
||||
"version": "7.3",
|
||||
"ref": "dae70df71978ae9226ae915ffd5fad817f5ca1f7"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/property_info.yaml"
|
||||
]
|
||||
},
|
||||
"symfony/routing": {
|
||||
"version": "7.2",
|
||||
"recipe": {
|
||||
|
||||
@@ -6,7 +6,7 @@ use Symfony\Component\Dotenv\Dotenv;
|
||||
|
||||
require dirname(__DIR__).'/vendor/autoload.php';
|
||||
|
||||
(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
|
||||
new Dotenv()->bootEnv(dirname(__DIR__).'/.env');
|
||||
|
||||
if ($_SERVER['APP_DEBUG']) {
|
||||
umask(0000);
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
</trans-unit>
|
||||
<trans-unit id="RnI7jJT" resname="Enter your name">
|
||||
<source>Enter your name</source>
|
||||
<target>Voor je naam in</target>
|
||||
<target>Voer je naam in</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="HNMwvRn" resname="Error clearing quiz">
|
||||
<source>Error clearing quiz</source>
|
||||
|
||||
Reference in New Issue
Block a user