From 0b64073e0ca094704fe5ce27d580b4c53e0c4b30 Mon Sep 17 00:00:00 2001 From: Ambroise Maupate Date: Mon, 2 Dec 2024 12:03:06 +0100 Subject: [PATCH] chore: Upgraded dependencies to allow PHP 8.4 (#26) --- .github/workflows/run-test.yml | 2 ++ .php-cs-fixer.dist.php | 10 +++++++- Dockerfile | 4 ++-- compose.yml | 1 + composer.json | 6 ++--- config/bundles.php | 2 -- docker/php/conf.d/app.dev.ini | 24 ++++++------------- lib/RoadizCoreBundle/composer.json | 4 ++-- .../WebResponseDataTransformerInterface.php | 4 ++-- src/DataFixtures/ArticleFixtures.php | 14 +++++------ src/DataFixtures/OfferFixtures.php | 10 ++++---- 11 files changed, 40 insertions(+), 41 deletions(-) diff --git a/.github/workflows/run-test.yml b/.github/workflows/run-test.yml index 33fea93d..55bf7f4b 100644 --- a/.github/workflows/run-test.yml +++ b/.github/workflows/run-test.yml @@ -42,6 +42,8 @@ jobs: run: | XDEBUG_MODE=coverage vendor/bin/phpunit -v - name: Run PHP Code Sniffer + env: + PHP_CS_FIXER_IGNORE_ENV: 1 run: | php -d "memory_limit=-1" vendor/bin/php-cs-fixer check --ansi -vvv - name: Run PHP Stan diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 72562bc4..de6dfdfc 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -2,7 +2,15 @@ $finder = (new PhpCsFixer\Finder()) ->in(__DIR__) - ->exclude(['var', 'vendor', 'docker', 'lib/EntityGenerator/tests/Mocks', 'config', 'node_modules']) + ->exclude([ + 'var', + 'vendor', + 'docker', + 'lib/EntityGenerator/tests/Mocks', + 'config', + 'node_modules', + 'src/GeneratedEntity', + ]) ; return (new PhpCsFixer\Config()) diff --git a/Dockerfile b/Dockerfile index 7959c70b..efcf7705 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ ARG UID=1000 ARG GID=${UID} -ARG PHP_VERSION=8.3.14 +ARG PHP_VERSION=8.4.1 ARG VARNISH_VERSION=7.6.1 ARG NGINX_VERSION=1.27.2 ARG MYSQL_VERSION=8.0.40 @@ -94,7 +94,7 @@ LABEL org.opencontainers.image.authors="ambroise@rezo-zero.com" ARG UID ARG GID -ARG COMPOSER_VERSION=2.8.1 +ARG COMPOSER_VERSION=2.8.2 ARG PHP_EXTENSION_INSTALLER_VERSION=2.6.0 ARG PHP_EXTENSION_REDIS_VERSION=6.1.0 diff --git a/compose.yml b/compose.yml index 7b30b6d4..4ba02e61 100644 --- a/compose.yml +++ b/compose.yml @@ -101,6 +101,7 @@ services: networks: - default environment: + PHP_CS_FIXER_IGNORE_ENV: 1 TRUSTED_PROXIES: ${TRUSTED_PROXIES} UID: ${UID} DEFAULT_GATEWAY: ${DEFAULT_GATEWAY} diff --git a/composer.json b/composer.json index b51b4012..2fa1ba57 100644 --- a/composer.json +++ b/composer.json @@ -58,7 +58,7 @@ "league/commonmark": "^2.2.0", "league/flysystem": "^3.0", "league/flysystem-bundle": "^3.0", - "lexik/jwt-authentication-bundle": "^2.19", + "lexik/jwt-authentication-bundle": "^3.1.0", "monolog/monolog": "^1.24.0 || ^2.1.1", "nelmio/cors-bundle": "^2.2", "nette/php-generator": "^4.1", @@ -67,7 +67,7 @@ "psr/cache": ">=1.0.1", "psr/log": ">=1.1", "ramsey/uuid": "^4.7", - "rezozero/intervention-request-bundle": "~3.0.0", + "rezozero/intervention-request-bundle": "~3.0.1", "rezozero/liform-bundle": "^0.20.1", "rezozero/tree-walker": "^1.5.0", "roadiz/nodetype-contracts": "~1.1.2", @@ -156,7 +156,7 @@ "symfony/maker-bundle": "^1.52", "symfony/phpunit-bridge": "^7.0", "symfony/web-profiler-bundle": "6.4.*", - "symplify/monorepo-builder": "11.2.2.72" + "symplify/monorepo-builder": "11.2.22" }, "config": { "optimize-autoloader": true, diff --git a/config/bundles.php b/config/bundles.php index 45f11a68..ee819bd6 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -1,7 +1,5 @@ ['all' => true], Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true], diff --git a/docker/php/conf.d/app.dev.ini b/docker/php/conf.d/app.dev.ini index 772b7271..900924dd 100644 --- a/docker/php/conf.d/app.dev.ini +++ b/docker/php/conf.d/app.dev.ini @@ -1,7 +1,3 @@ -error_reporting = E_ALL & ~E_DEPRECATED -html_errors = On - -apc.enable_cli = 0 date.timezone = Europe/Paris session.auto_start = Off ; Session ID cannot be passed through URLs @@ -16,23 +12,17 @@ short_open_tag = Off ; http://symfony.com/doc/current/performance.html ; Configure OPcache for Maximum Performance -opcache.enable=1 -opcache.memory_consumption=256 +opcache.revalidate_freq = 0 +opcache.memory_consumption = 256 opcache.max_accelerated_files = 20000 -; Don't Check PHP Files Timestamps -opcache.revalidate_freq=0 -opcache.validate_timestamps=1 -opcache.fast_shutdown=1 +opcache.interned_strings_buffer = 16 + ; Configure the PHP realpath Cache realpath_cache_size = 4096K realpath_cache_ttl = 600 + memory_limit = 512M -post_max_size = 256M -upload_max_filesize = 128M +post_max_size = 128M +upload_max_filesize = 64M expose_php = On display_errors = On -zend.detect_unicode = 0 - -# Sessions -;session.save_handler = redis -;session.save_path = "tcp://redis:6379" diff --git a/lib/RoadizCoreBundle/composer.json b/lib/RoadizCoreBundle/composer.json index 08642dfd..4c36ec7d 100644 --- a/lib/RoadizCoreBundle/composer.json +++ b/lib/RoadizCoreBundle/composer.json @@ -36,11 +36,11 @@ "jms/serializer-bundle": "^4.2.0", "league/flysystem": "^3.0", "league/flysystem-bundle": "^3.0", - "lexik/jwt-authentication-bundle": "^2.19", + "lexik/jwt-authentication-bundle": "^3.1.0", "phpdocumentor/reflection-docblock": "^5.2", "phpoffice/phpspreadsheet": "^1.15", "ramsey/uuid": "^4.7", - "rezozero/intervention-request-bundle": "~3.0.0", + "rezozero/intervention-request-bundle": "~3.0.1", "rezozero/liform-bundle": "^0.20.1", "rezozero/tree-walker": "^1.5.0", "roadiz/doc-generator": "2.4.x-dev", diff --git a/lib/RoadizCoreBundle/src/Api/DataTransformer/WebResponseDataTransformerInterface.php b/lib/RoadizCoreBundle/src/Api/DataTransformer/WebResponseDataTransformerInterface.php index 58d03727..72adf6f8 100644 --- a/lib/RoadizCoreBundle/src/Api/DataTransformer/WebResponseDataTransformerInterface.php +++ b/lib/RoadizCoreBundle/src/Api/DataTransformer/WebResponseDataTransformerInterface.php @@ -12,8 +12,8 @@ interface WebResponseDataTransformerInterface /** * @template T of PersistableInterface * - * @param T $object - * @param WebResponseInterface|null $output Pass an existing WebResponseInterface instance to avoid creating a new one. + * @param T $object + * @param WebResponseInterface|null $output pass an existing WebResponseInterface instance to avoid creating a new one * * @return WebResponseInterface|null */ diff --git a/src/DataFixtures/ArticleFixtures.php b/src/DataFixtures/ArticleFixtures.php index fc5ad0a3..ffbfde5c 100644 --- a/src/DataFixtures/ArticleFixtures.php +++ b/src/DataFixtures/ArticleFixtures.php @@ -8,6 +8,8 @@ use Doctrine\Common\DataFixtures\DependentFixtureInterface; use Doctrine\Persistence\ObjectManager; use RZ\Roadiz\CoreBundle\Entity\Node; +use RZ\Roadiz\CoreBundle\Entity\NodeType; +use RZ\Roadiz\CoreBundle\Entity\Translation; use RZ\Roadiz\CoreBundle\Node\UniqueNodeGenerator; class ArticleFixtures extends Fixture implements DependentFixtureInterface @@ -28,10 +30,8 @@ public function getDependencies(): array public function load(ObjectManager $manager): void { $articleContainer = $this->uniqueNodeGenerator->generate( - // @phpstan-ignore-next-line - nodeType: $this->getReference(NodeTypeFixtures::NS_ARTICLE_CONTAINER), - // @phpstan-ignore-next-line - translation: $this->getReference(AppFixtures::DEFAULT_TRANSLATION_REFERENCE), + nodeType: $this->getReference(NodeTypeFixtures::NS_ARTICLE_CONTAINER, NodeType::class), + translation: $this->getReference(AppFixtures::DEFAULT_TRANSLATION_REFERENCE, Translation::class), flush: false, ); $articleContainer->setTitle('Articles container'); @@ -41,10 +41,8 @@ public function load(ObjectManager $manager): void for ($i = 0; $i < 50; ++$i) { $article = $this->uniqueNodeGenerator->generate( - // @phpstan-ignore-next-line - nodeType: $this->getReference(NodeTypeFixtures::NS_ARTICLE), - // @phpstan-ignore-next-line - translation: $this->getReference(AppFixtures::DEFAULT_TRANSLATION_REFERENCE), + nodeType: $this->getReference(NodeTypeFixtures::NS_ARTICLE, NodeType::class), + translation: $this->getReference(AppFixtures::DEFAULT_TRANSLATION_REFERENCE, Translation::class), parent: $articleContainer->getNode(), flush: false, ); diff --git a/src/DataFixtures/OfferFixtures.php b/src/DataFixtures/OfferFixtures.php index 732eb9c8..07dd484b 100644 --- a/src/DataFixtures/OfferFixtures.php +++ b/src/DataFixtures/OfferFixtures.php @@ -9,6 +9,8 @@ use Doctrine\Common\DataFixtures\DependentFixtureInterface; use Doctrine\Persistence\ObjectManager; use RZ\Roadiz\CoreBundle\Entity\Node; +use RZ\Roadiz\CoreBundle\Entity\NodeType; +use RZ\Roadiz\CoreBundle\Entity\Translation; use RZ\Roadiz\CoreBundle\Node\UniqueNodeGenerator; class OfferFixtures extends Fixture implements DependentFixtureInterface @@ -30,9 +32,9 @@ public function load(ObjectManager $manager): void { $offerContainer = $this->uniqueNodeGenerator->generate( // @phpstan-ignore-next-line - nodeType: $this->getReference(NodeTypeFixtures::NS_NEUTRAL), + nodeType: $this->getReference(NodeTypeFixtures::NS_NEUTRAL, NodeType::class), // @phpstan-ignore-next-line - translation: $this->getReference(AppFixtures::DEFAULT_TRANSLATION_REFERENCE), + translation: $this->getReference(AppFixtures::DEFAULT_TRANSLATION_REFERENCE, Translation::class), flush: false, ); $offerContainer->setTitle('Offers container'); @@ -43,9 +45,9 @@ public function load(ObjectManager $manager): void /** @var NSOffer $offer */ $offer = $this->uniqueNodeGenerator->generate( // @phpstan-ignore-next-line - nodeType: $this->getReference(NodeTypeFixtures::NS_OFFER), + nodeType: $this->getReference(NodeTypeFixtures::NS_OFFER, NodeType::class), // @phpstan-ignore-next-line - translation: $this->getReference(AppFixtures::DEFAULT_TRANSLATION_REFERENCE), + translation: $this->getReference(AppFixtures::DEFAULT_TRANSLATION_REFERENCE, Translation::class), parent: $offerContainer->getNode(), flush: false, );