diff --git a/.github/workflows/frankenphp.yml b/.github/workflows/frankenphp.yml index 24ca1b6b..253e4172 100644 --- a/.github/workflows/frankenphp.yml +++ b/.github/workflows/frankenphp.yml @@ -25,7 +25,7 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Build Docker images - uses: docker/bake-action@v4 + uses: docker/bake-action@v6 with: pull: true load: true diff --git a/.github/workflows/postgres.yml b/.github/workflows/postgres.yml index ca33dde2..fb511e9a 100644 --- a/.github/workflows/postgres.yml +++ b/.github/workflows/postgres.yml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['8.2', '8.3'] + php-versions: ['8.4'] steps: - name: Checkout uses: actions/checkout@v4 diff --git a/Dockerfile b/Dockerfile index ca156aed..df021d17 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -#syntax=docker/dockerfile:1.4 +#syntax=docker/dockerfile:1 # Versions FROM dunglas/frankenphp:1-php8.3 AS frankenphp_upstream @@ -37,10 +37,12 @@ RUN set -eux; \ # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser ENV COMPOSER_ALLOW_SUPERUSER=1 +ENV PHP_INI_SCAN_DIR=":$PHP_INI_DIR/app.conf.d" + ###> recipes ### ###> symfony/panther ### # Chromium and ChromeDriver -ENV PANTHER_NO_SANDBOX 1 +ENV PANTHER_NO_SANDBOX=1 # Not mandatory, but recommended ENV PANTHER_CHROME_ARGUMENTS='--disable-dev-shm-usage' RUN apt-get update && apt-get install -y --no-install-recommends chromium chromium-driver && rm -rf /var/lib/apt/lists/* @@ -58,7 +60,7 @@ RUN install-php-extensions pdo_mysql ###< doctrine/doctrine-bundle ### ###< recipes ### -COPY --link frankenphp/conf.d/app.ini $PHP_INI_DIR/conf.d/ +COPY --link frankenphp/conf.d/10-app.ini $PHP_INI_DIR/app.conf.d/ COPY --link --chmod=755 frankenphp/docker-entrypoint.sh /usr/local/bin/docker-entrypoint COPY --link frankenphp/Caddyfile /etc/caddy/Caddyfile @@ -79,7 +81,7 @@ RUN set -eux; \ xdebug \ ; -COPY --link frankenphp/conf.d/app.dev.ini $PHP_INI_DIR/conf.d/ +COPY --link frankenphp/conf.d/20-app.dev.ini $PHP_INI_DIR/app.conf.d/ CMD [ "frankenphp", "run", "--config", "/etc/caddy/Caddyfile", "--watch" ] @@ -91,7 +93,7 @@ ENV FRANKENPHP_CONFIG="import worker.Caddyfile" RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" -COPY --link frankenphp/conf.d/app.prod.ini $PHP_INI_DIR/conf.d/ +COPY --link frankenphp/conf.d/20-app.prod.ini $PHP_INI_DIR/app.conf.d/ COPY --link frankenphp/worker.Caddyfile /etc/caddy/worker.Caddyfile # prevent the reinstallation of vendors at every changes in the source code diff --git a/compose.override.yaml b/compose.override.yaml index 5d29da0e..3a6a3808 100644 --- a/compose.override.yaml +++ b/compose.override.yaml @@ -7,7 +7,7 @@ services: volumes: - ./:/app - ./frankenphp/Caddyfile:/etc/caddy/Caddyfile:ro - - ./frankenphp/conf.d/app.dev.ini:/usr/local/etc/php/conf.d/app.dev.ini:ro + - ./frankenphp/conf.d/20-app.dev.ini:/usr/local/etc/php/app.conf.d/20-app.dev.ini:ro # If you develop on Mac or Windows you can remove the vendor/ directory # from the bind-mount for better performance by enabling the next line: #- /app/vendor @@ -39,3 +39,12 @@ services: MP_SMTP_AUTH_ACCEPT_ANY: 1 MP_SMTP_AUTH_ALLOW_INSECURE: 1 ###< symfony/mailer ### + + phpmyadmin: + image: phpmyadmin/phpmyadmin + restart: unless-stopped + environment: + PMA_HOST: mysql + PMA_PORT: 3306 + ports: + - 8081:80 diff --git a/compose.yaml b/compose.yaml index 0578d538..88063494 100644 --- a/compose.yaml +++ b/compose.yaml @@ -6,13 +6,11 @@ services: SERVER_NAME: ${SERVER_NAME:-localhost}, php:80 MERCURE_PUBLISHER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!} MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!} - TRUSTED_PROXIES: ${TRUSTED_PROXIES:-127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16} - TRUSTED_HOSTS: ${TRUSTED_HOSTS:-^${SERVER_NAME:-example\.com|localhost}|php$$} # Run "composer require symfony/orm-pack" to install and configure Doctrine ORM DATABASE_URL: mysql://${MYSQL_USER:-app}:${MYSQL_PASSWORD:-!ChangeMe!}@mysql:3306/${MYSQL_DATABASE:-app}?serverVersion=${MYSQL_VERSION:-8.0.35}&charset=utf8mb4 # Run "composer require symfony/mercure-bundle" to install and configure the Mercure integration MERCURE_URL: ${CADDY_MERCURE_URL:-http://php/.well-known/mercure} - MERCURE_PUBLIC_URL: ${CADDY_MERCURE_PUBLIC_URL:-https://${SERVER_NAME:-localhost}/.well-known/mercure} + MERCURE_PUBLIC_URL: ${CADDY_MERCURE_PUBLIC_URL:-https://${SERVER_NAME:-localhost}:${HTTPS_PORT:-443}/.well-known/mercure} MERCURE_JWT_SECRET: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!} # The two next lines can be removed after initial installation SYMFONY_VERSION: ${SYMFONY_VERSION:-} @@ -53,15 +51,6 @@ services: - 3306:3306 ###< doctrine/doctrine-bundle ### - phpmyadmin: - image: phpmyadmin/phpmyadmin - restart: unless-stopped - environment: - PMA_HOST: mysql - PMA_PORT: 3306 - ports: - - 8081:80 - volumes: caddy_data: caddy_config: diff --git a/composer.json b/composer.json index d94145e6..e89904cf 100644 --- a/composer.json +++ b/composer.json @@ -64,7 +64,7 @@ "doctrine/doctrine-fixtures-bundle": "^3.6", "friendsofphp/php-cs-fixer": "^3.59", "phpunit/phpunit": "^9.6", - "rector/rector": "^1.2", + "rector/rector": "^2.0", "symfony/browser-kit": "^7.1", "symfony/css-selector": "^7.1", "symfony/debug-bundle": "^7.1", diff --git a/composer.lock b/composer.lock index eb98b4a3..1fbf79d5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c556fc2234f7b4ee6166ecf46e971828", + "content-hash": "d715ac06371aa22cdc758e9e4f37e580", "packages": [ { "name": "bacon/bacon-qr-code", @@ -8669,16 +8669,16 @@ }, { "name": "twig/twig", - "version": "v3.18.0", + "version": "v3.19.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "acffa88cc2b40dbe42eaf3a5025d6c0d4600cc50" + "reference": "d4f8c2b86374f08efc859323dbcd95c590f7124e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/acffa88cc2b40dbe42eaf3a5025d6c0d4600cc50", - "reference": "acffa88cc2b40dbe42eaf3a5025d6c0d4600cc50", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/d4f8c2b86374f08efc859323dbcd95c590f7124e", + "reference": "d4f8c2b86374f08efc859323dbcd95c590f7124e", "shasum": "" }, "require": { @@ -8733,7 +8733,7 @@ ], "support": { "issues": "https://github.com/twigphp/Twig/issues", - "source": "https://github.com/twigphp/Twig/tree/v3.18.0" + "source": "https://github.com/twigphp/Twig/tree/v3.19.0" }, "funding": [ { @@ -8745,7 +8745,7 @@ "type": "tidelift" } ], - "time": "2024-12-29T10:51:50+00:00" + "time": "2025-01-29T07:06:14+00:00" }, { "name": "voku/portable-ascii", @@ -10025,20 +10025,20 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.14", + "version": "2.1.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "e73868f809e68fff33be961ad4946e2e43ec9e38" + "reference": "7d08f569e582ade182a375c366cbd896eccadd3a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e73868f809e68fff33be961ad4946e2e43ec9e38", - "reference": "e73868f809e68fff33be961ad4946e2e43ec9e38", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/7d08f569e582ade182a375c366cbd896eccadd3a", + "reference": "7d08f569e582ade182a375c366cbd896eccadd3a", "shasum": "" }, "require": { - "php": "^7.2|^8.0" + "php": "^7.4|^8.0" }, "conflict": { "phpstan/phpstan-shim": "*" @@ -10079,7 +10079,7 @@ "type": "github" } ], - "time": "2024-12-31T07:26:13+00:00" + "time": "2025-01-21T14:54:06+00:00" }, { "name": "phpunit/php-code-coverage", @@ -11031,21 +11031,21 @@ }, { "name": "rector/rector", - "version": "1.2.10", + "version": "2.0.8", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "40f9cf38c05296bd32f444121336a521a293fa61" + "reference": "3c70238bc677eb98866000a05b19a34f12955954" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/40f9cf38c05296bd32f444121336a521a293fa61", - "reference": "40f9cf38c05296bd32f444121336a521a293fa61", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/3c70238bc677eb98866000a05b19a34f12955954", + "reference": "3c70238bc677eb98866000a05b19a34f12955954", "shasum": "" }, "require": { - "php": "^7.2|^8.0", - "phpstan/phpstan": "^1.12.5" + "php": "^7.4|^8.0", + "phpstan/phpstan": "^2.1.2" }, "conflict": { "rector/rector-doctrine": "*", @@ -11078,7 +11078,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/1.2.10" + "source": "https://github.com/rectorphp/rector/tree/2.0.8" }, "funding": [ { @@ -11086,7 +11086,7 @@ "type": "github" } ], - "time": "2024-11-08T13:59:10+00:00" + "time": "2025-02-06T14:02:49+00:00" }, { "name": "sebastian/cli-parser", diff --git a/config/services.yaml b/config/services.yaml index 6431c452..59af8a91 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -7,7 +7,7 @@ parameters: locale: 'en' app_locales: 'en|ru|nl|bg|hu' images_directory: '%kernel.project_dir%/public/uploads/images' - app_version: '2.11.2' + app_version: '2.11.3' services: # default configuration for services in *this* file diff --git a/frankenphp/Caddyfile b/frankenphp/Caddyfile index b8bb57db..b8813674 100644 --- a/frankenphp/Caddyfile +++ b/frankenphp/Caddyfile @@ -10,6 +10,7 @@ {$SERVER_NAME:localhost} { log { + {$CADDY_SERVER_LOG_OPTIONS} # Redact the authorization query parameter that can be set by Mercure format filter { request>uri query { @@ -18,7 +19,7 @@ } } - root * /app/public + root /app/public encode zstd br gzip mercure { @@ -43,5 +44,16 @@ # Disable Topics tracking if not enabled explicitly: https://github.com/jkarlin/topics header ?Permissions-Policy "browsing-topics=()" - php_server + @phpRoute { + not path /.well-known/mercure* + not file {path} + } + rewrite @phpRoute index.php + + @frontController path index.php + php @frontController + + file_server { + hide *.php + } } diff --git a/frankenphp/conf.d/app.ini b/frankenphp/conf.d/10-app.ini similarity index 99% rename from frankenphp/conf.d/app.ini rename to frankenphp/conf.d/10-app.ini index 497bc884..caee2b0a 100644 --- a/frankenphp/conf.d/app.ini +++ b/frankenphp/conf.d/10-app.ini @@ -2,9 +2,10 @@ expose_php = 0 date.timezone = UTC apc.enable_cli = 1 session.use_strict_mode = 1 +zend.detect_unicode = 0 + upload_max_filesize = 16M post_max_size = 32M -zend.detect_unicode = 0 ; https://symfony.com/doc/current/performance.html realpath_cache_size = 4096K diff --git a/frankenphp/conf.d/app.dev.ini b/frankenphp/conf.d/20-app.dev.ini similarity index 100% rename from frankenphp/conf.d/app.dev.ini rename to frankenphp/conf.d/20-app.dev.ini diff --git a/frankenphp/conf.d/20-app.prod.ini b/frankenphp/conf.d/20-app.prod.ini new file mode 100644 index 00000000..b716441a --- /dev/null +++ b/frankenphp/conf.d/20-app.prod.ini @@ -0,0 +1,5 @@ +; https://symfony.com/doc/current/performance.html#use-the-opcache-class-preloading +opcache.preload_user = root +opcache.preload = /app/config/preload.php +; https://symfony.com/doc/current/performance.html#don-t-check-php-files-timestamps +opcache.validate_timestamps = 0 diff --git a/frankenphp/conf.d/app.prod.ini b/frankenphp/conf.d/app.prod.ini deleted file mode 100644 index 3bcaa71e..00000000 --- a/frankenphp/conf.d/app.prod.ini +++ /dev/null @@ -1,2 +0,0 @@ -opcache.preload_user = root -opcache.preload = /app/config/preload.php diff --git a/frankenphp/docker-entrypoint.sh b/frankenphp/docker-entrypoint.sh index 9823560f..0f6716dd 100644 --- a/frankenphp/docker-entrypoint.sh +++ b/frankenphp/docker-entrypoint.sh @@ -17,7 +17,7 @@ if [ "$1" = 'frankenphp' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then composer config --json extra.symfony.docker 'true' if grep -q ^DATABASE_URL= .env; then - echo "To finish the installation please press Ctrl+C to stop Docker Compose and run: docker compose up --build -d --wait" + echo 'To finish the installation please press Ctrl+C to stop Docker Compose and run: docker compose up --build -d --wait' sleep infinity fi fi @@ -26,8 +26,12 @@ if [ "$1" = 'frankenphp' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then composer install --prefer-dist --no-progress --no-interaction fi + # Display information about the current project + # Or about an error in project initialization + php bin/console -V + if grep -q ^DATABASE_URL= .env; then - echo "Waiting for database to be ready..." + echo 'Waiting for database to be ready...' ATTEMPTS_LEFT_TO_REACH_DATABASE=60 until [ $ATTEMPTS_LEFT_TO_REACH_DATABASE -eq 0 ] || DATABASE_ERROR=$(php bin/console dbal:run-sql -q "SELECT 1" 2>&1); do if [ $? -eq 255 ]; then @@ -41,11 +45,11 @@ if [ "$1" = 'frankenphp' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then done if [ $ATTEMPTS_LEFT_TO_REACH_DATABASE -eq 0 ]; then - echo "The database is not up or not reachable:" + echo 'The database is not up or not reachable:' echo "$DATABASE_ERROR" exit 1 else - echo "The database is now ready and reachable" + echo 'The database is now ready and reachable' fi if [ "$( find ./migrations -iname '*.php' -print -quit )" ]; then @@ -55,6 +59,8 @@ if [ "$1" = 'frankenphp' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then setfacl -R -m u:www-data:rwX -m u:"$(whoami)":rwX var setfacl -dR -m u:www-data:rwX -m u:"$(whoami)":rwX var + + echo 'PHP app ready!' fi exec docker-php-entrypoint "$@" diff --git a/src/Controller/Admin/CategoryController.php b/src/Controller/Admin/CategoryController.php index 038afdab..c932b1c9 100644 --- a/src/Controller/Admin/CategoryController.php +++ b/src/Controller/Admin/CategoryController.php @@ -9,8 +9,8 @@ use App\Form\Type\CategoryType; use App\Repository\CategoryRepository; use App\Service\Admin\CategoryService; -use Symfony\Component\Form\ClickableInterface; use Symfony\Component\Form\Extension\Core\Type\SubmitType; +use Symfony\Component\Form\SubmitButton; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Attribute\Route; @@ -42,7 +42,7 @@ public function new(Request $request, CategoryService $service): Response if ($form->isSubmitted() && $form->isValid()) { $service->create($category); - /** @var ClickableInterface $button */ + /** @var SubmitButton $button */ $button = $form->get('saveAndCreateNew'); if ($button->isClicked()) { return $this->redirectToRoute('admin_category_new'); diff --git a/src/Controller/Admin/CityController.php b/src/Controller/Admin/CityController.php index f000e586..d5381e56 100644 --- a/src/Controller/Admin/CityController.php +++ b/src/Controller/Admin/CityController.php @@ -9,8 +9,8 @@ use App\Form\Type\CityType; use App\Repository\CityRepository; use App\Service\Admin\CityService; -use Symfony\Component\Form\ClickableInterface; use Symfony\Component\Form\Extension\Core\Type\SubmitType; +use Symfony\Component\Form\SubmitButton; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Attribute\Route; @@ -42,7 +42,7 @@ public function new(Request $request, CityService $service): Response if ($form->isSubmitted() && $form->isValid()) { $service->create($city); - /** @var ClickableInterface $button */ + /** @var SubmitButton $button */ $button = $form->get('saveAndCreateNew'); if ($button->isClicked()) { return $this->redirectToRoute('admin_city_new'); diff --git a/src/Controller/Admin/CurrencyController.php b/src/Controller/Admin/CurrencyController.php index 3dc6e0e9..6a18107a 100644 --- a/src/Controller/Admin/CurrencyController.php +++ b/src/Controller/Admin/CurrencyController.php @@ -8,8 +8,8 @@ use App\Entity\Currency; use App\Form\Type\CurrencyType; use App\Repository\CurrencyRepository; -use Symfony\Component\Form\ClickableInterface; use Symfony\Component\Form\Extension\Core\Type\SubmitType; +use Symfony\Component\Form\SubmitButton; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Attribute\Route; @@ -43,7 +43,7 @@ public function new(Request $request): Response $this->addFlash('success', 'message.created'); - /** @var ClickableInterface $button */ + /** @var SubmitButton $button */ $button = $form->get('saveAndCreateNew'); if ($button->isClicked()) { return $this->redirectToRoute('admin_currency_new'); diff --git a/src/Controller/Admin/DealTypeController.php b/src/Controller/Admin/DealTypeController.php index 7ac7748a..a7553fe2 100644 --- a/src/Controller/Admin/DealTypeController.php +++ b/src/Controller/Admin/DealTypeController.php @@ -8,8 +8,8 @@ use App\Entity\DealType; use App\Form\Type\DealTypeType; use App\Service\Admin\DealTypeService; -use Symfony\Component\Form\ClickableInterface; use Symfony\Component\Form\Extension\Core\Type\SubmitType; +use Symfony\Component\Form\SubmitButton; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Attribute\Route; @@ -43,7 +43,7 @@ public function new(Request $request, DealTypeService $service): Response if ($form->isSubmitted() && $form->isValid()) { $service->create($dealType); - /** @var ClickableInterface $button */ + /** @var SubmitButton $button */ $button = $form->get('saveAndCreateNew'); if ($button->isClicked()) { return $this->redirectToRoute('admin_deal_type_new'); diff --git a/src/Controller/Admin/DistrictController.php b/src/Controller/Admin/DistrictController.php index e4d5c596..60d0caed 100644 --- a/src/Controller/Admin/DistrictController.php +++ b/src/Controller/Admin/DistrictController.php @@ -8,8 +8,8 @@ use App\Entity\District; use App\Form\Type\DistrictType; use App\Repository\CityRepository; -use Symfony\Component\Form\ClickableInterface; use Symfony\Component\Form\Extension\Core\Type\SubmitType; +use Symfony\Component\Form\SubmitButton; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Attribute\Route; @@ -45,7 +45,7 @@ public function new(Request $request): Response $this->addFlash('success', 'message.created'); - /** @var ClickableInterface $button */ + /** @var SubmitButton $button */ $button = $form->get('saveAndCreateNew'); if ($button->isClicked()) { return $this->redirectToRoute('admin_district_new'); diff --git a/src/Controller/Admin/FeatureController.php b/src/Controller/Admin/FeatureController.php index 43072cfd..a7ed5b7e 100644 --- a/src/Controller/Admin/FeatureController.php +++ b/src/Controller/Admin/FeatureController.php @@ -8,8 +8,8 @@ use App\Entity\Feature; use App\Form\Type\FeatureType; use App\Repository\FeatureRepository; -use Symfony\Component\Form\ClickableInterface; use Symfony\Component\Form\Extension\Core\Type\SubmitType; +use Symfony\Component\Form\SubmitButton; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Attribute\Route; @@ -43,7 +43,7 @@ public function new(Request $request): Response $this->addFlash('success', 'message.created'); - /** @var ClickableInterface $button */ + /** @var SubmitButton $button */ $button = $form->get('saveAndCreateNew'); if ($button->isClicked()) { return $this->redirectToRoute('admin_feature_new'); diff --git a/src/Controller/Admin/MenuController.php b/src/Controller/Admin/MenuController.php index f549317f..8972f3b2 100644 --- a/src/Controller/Admin/MenuController.php +++ b/src/Controller/Admin/MenuController.php @@ -8,8 +8,8 @@ use App\Entity\Menu; use App\Form\Type\MenuType; use App\Repository\MenuRepository; -use Symfony\Component\Form\ClickableInterface; use Symfony\Component\Form\Extension\Core\Type\SubmitType; +use Symfony\Component\Form\SubmitButton; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Attribute\Route; @@ -42,7 +42,7 @@ public function new(Request $request): Response $this->addFlash('success', 'message.created'); - /** @var ClickableInterface $button */ + /** @var SubmitButton $button */ $button = $form->get('saveAndCreateNew'); if ($button->isClicked()) { return $this->redirectToRoute('admin_menu_new'); diff --git a/src/Controller/Admin/MetroController.php b/src/Controller/Admin/MetroController.php index 7a0f34b1..6293c00a 100644 --- a/src/Controller/Admin/MetroController.php +++ b/src/Controller/Admin/MetroController.php @@ -8,8 +8,8 @@ use App\Entity\Metro; use App\Form\Type\MetroType; use App\Repository\CityRepository; -use Symfony\Component\Form\ClickableInterface; use Symfony\Component\Form\Extension\Core\Type\SubmitType; +use Symfony\Component\Form\SubmitButton; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Attribute\Route; @@ -45,7 +45,7 @@ public function new(Request $request): Response $this->addFlash('success', 'message.created'); - /** @var ClickableInterface $button */ + /** @var SubmitButton $button */ $button = $form->get('saveAndCreateNew'); if ($button->isClicked()) { return $this->redirectToRoute('admin_metro_new'); diff --git a/src/Controller/Admin/NeighborhoodController.php b/src/Controller/Admin/NeighborhoodController.php index 44e7d979..bff9a94c 100644 --- a/src/Controller/Admin/NeighborhoodController.php +++ b/src/Controller/Admin/NeighborhoodController.php @@ -8,8 +8,8 @@ use App\Entity\Neighborhood; use App\Form\Type\NeighborhoodType; use App\Repository\CityRepository; -use Symfony\Component\Form\ClickableInterface; use Symfony\Component\Form\Extension\Core\Type\SubmitType; +use Symfony\Component\Form\SubmitButton; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Attribute\Route; @@ -45,7 +45,7 @@ public function new(Request $request): Response $this->addFlash('success', 'message.created'); - /** @var ClickableInterface $button */ + /** @var SubmitButton $button */ $button = $form->get('saveAndCreateNew'); if ($button->isClicked()) { return $this->redirectToRoute('admin_neighborhood_new'); diff --git a/src/Controller/Admin/UserController.php b/src/Controller/Admin/UserController.php index 8bda5fe2..04a08c53 100644 --- a/src/Controller/Admin/UserController.php +++ b/src/Controller/Admin/UserController.php @@ -10,8 +10,8 @@ use App\Repository\UserRepository; use App\Service\Admin\UserService; use App\Utils\UserFormDataSelector; -use Symfony\Component\Form\ClickableInterface; use Symfony\Component\Form\Extension\Core\Type\SubmitType; +use Symfony\Component\Form\SubmitButton; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Attribute\Route; @@ -45,7 +45,7 @@ public function new(Request $request, UserService $service, UserFormDataSelector $user->setEmailVerifiedAt($emailVerifiedAt); $service->create($user); - /** @var ClickableInterface $button */ + /** @var SubmitButton $button */ $button = $form->get('saveAndCreateNew'); if ($button->isClicked()) { return $this->redirectToRoute('admin_user_new'); diff --git a/src/Security/RegistrationFormAuthenticator.php b/src/Security/RegistrationFormAuthenticator.php index aeeff5b2..812319f2 100644 --- a/src/Security/RegistrationFormAuthenticator.php +++ b/src/Security/RegistrationFormAuthenticator.php @@ -37,7 +37,7 @@ public function authenticate(Request $request): Passport ); } - public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): ?Response + public function onAuthenticationSuccess(Request $request, TokenInterface $token, string $firewallName): Response { return new RedirectResponse($this->urlGenerator->generate('user_property')); } @@ -47,7 +47,7 @@ public function supports(Request $request): ?bool return false; } - public function onAuthenticationFailure(Request $request, AuthenticationException $exception): ?Response + public function onAuthenticationFailure(Request $request, AuthenticationException $exception): Response { return new RedirectResponse($this->urlGenerator->generate('security_login')); }