From 0e2910a1b1fffa85091589c18d6ebc1b130b9798 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 25 May 2024 16:42:30 +0000 Subject: [PATCH 1/2] Build(deps-dev): Bump vimeo/psalm from 5.23.1 to 5.24.0 Bumps [vimeo/psalm](https://github.com/vimeo/psalm) from 5.23.1 to 5.24.0. - [Release notes](https://github.com/vimeo/psalm/releases) - [Commits](https://github.com/vimeo/psalm/compare/5.23.1...5.24.0) --- updated-dependencies: - dependency-name: vimeo/psalm dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- composer.json | 2 +- composer.lock | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/composer.json b/composer.json index 630aafa2c2..ce2aa40842 100644 --- a/composer.json +++ b/composer.json @@ -90,7 +90,7 @@ "symfony/phpunit-bridge": "6.4.*", "symfony/stopwatch": "6.4.*", "symfony/web-profiler-bundle": "6.4.*", - "vimeo/psalm": "5.23.*", + "vimeo/psalm": "5.24.*", "wapmorgan/php-deprecation-detector": "2.0.*", "textalk/websocket": "1.5.8.*" }, diff --git a/composer.lock b/composer.lock index 84d21fcd82..2c07040f11 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": "e72120688e15b0d59385ec7085c98a0f", + "content-hash": "3cfeb62e455f0523049fddeb318a8f38", "packages": [ { "name": "beberlei/doctrineextensions", @@ -15483,16 +15483,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.4.0", + "version": "5.4.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "298d2febfe79d03fe714eb871d5538da55205b1a" + "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/298d2febfe79d03fe714eb871d5538da55205b1a", - "reference": "298d2febfe79d03fe714eb871d5538da55205b1a", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", + "reference": "9d07b3f7fdcf5efec5d1609cba3c19c5ea2bdc9c", "shasum": "" }, "require": { @@ -15541,9 +15541,9 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.4.0" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.4.1" }, - "time": "2024-04-09T21:13:58+00:00" + "time": "2024-05-21T05:55:05+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -18411,16 +18411,16 @@ }, { "name": "vimeo/psalm", - "version": "5.23.1", + "version": "5.24.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "8471a896ccea3526b26d082f4461eeea467f10a4" + "reference": "462c80e31c34e58cc4f750c656be3927e80e550e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/8471a896ccea3526b26d082f4461eeea467f10a4", - "reference": "8471a896ccea3526b26d082f4461eeea467f10a4", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/462c80e31c34e58cc4f750c656be3927e80e550e", + "reference": "462c80e31c34e58cc4f750c656be3927e80e550e", "shasum": "" }, "require": { @@ -18517,7 +18517,7 @@ "issues": "https://github.com/vimeo/psalm/issues", "source": "https://github.com/vimeo/psalm" }, - "time": "2024-03-11T20:33:46+00:00" + "time": "2024-05-01T19:32:08+00:00" }, { "name": "wapmorgan/php-deprecation-detector", From ff189ea95150cb742c09ffa09229e94c2953c2a3 Mon Sep 17 00:00:00 2001 From: Daniel Metzner Date: Sat, 25 May 2024 19:25:43 +0200 Subject: [PATCH 2/2] Fix psalm issues, and check for all available files in psalm + phpstan Signed-off-by: Daniel Metzner --- config/bootstrap.php | 6 ++++-- config/routes.php | 2 +- deploy.php | 7 +++++++ phpstan.neon | 9 ++++++--- psalm.xml | 20 ++++++++++++++++---- public/index.php | 2 ++ public/index_test.php | 6 ++++-- 7 files changed, 40 insertions(+), 12 deletions(-) diff --git a/config/bootstrap.php b/config/bootstrap.php index 37649702ce..c1bbf32d59 100644 --- a/config/bootstrap.php +++ b/config/bootstrap.php @@ -1,5 +1,7 @@ =1.2) if (is_array($env = @include dirname(__DIR__).'/.env.local.php') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) { - (new Dotenv())->usePutenv(true)->populate($env); + (new Dotenv())->usePutenv()->populate($env); } else { // load all the .env files - (new Dotenv())->usePutenv(true)->loadEnv(dirname(__DIR__).'/.env'); + (new Dotenv())->usePutenv()->loadEnv(dirname(__DIR__).'/.env'); } $_SERVER += $_ENV; diff --git a/config/routes.php b/config/routes.php index 44ab89ef97..92f5dd8c04 100644 --- a/config/routes.php +++ b/config/routes.php @@ -15,7 +15,7 @@ $routingConfigurator->add('apple_login', '/login/check-apple'); $routingConfigurator->add('gesdinet_jwt_refresh_token', '/api/authentication/refresh') - ->controller(App\Api\Services\Authentication\JWTTokenRefreshService::class.'::refresh') + ->controller([App\Api\Services\Authentication\JWTTokenRefreshService::class, 'refresh']) ; $routingConfigurator->import('@OpenAPIServerBundle/Resources/config/routing.yaml') diff --git a/deploy.php b/deploy.php index 4aa34f7355..8203c73a45 100644 --- a/deploy.php +++ b/deploy.php @@ -152,6 +152,12 @@ function loadEnvVariables(string $filename): void run('bin/console doctrine:migrations:rollup -n'); }); +// dump the .env file as .env.local.php to speed up the loading of the env vars +task('dump:env', function () { + cd('{{release_path}}'); + run('composer dump-env prod'); +}); + /* * Main task */ @@ -161,6 +167,7 @@ function loadEnvVariables(string $filename): void 'deploy:clear_paths', 'deploy:vendors', 'install:assets', + 'dump:env', 'deploy:cache:clear', 'deploy:writable', 'deploy:symlink', diff --git a/phpstan.neon b/phpstan.neon index b6b52134ae..ed3666a963 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -5,9 +5,12 @@ parameters: - config/bootstrap_test.php level: 6 # 0 is the loosest lvl and 9 is the strictest (https://phpstan.org/user-guide/rule-levels) paths: - - src - - config - - tests + - . # Analyze all directories in the project + excludePaths: + - node_modules/**/* + - var/**/* + - vendor/**/* + - deploy.php inferPrivatePropertyTypeFromConstructor: true reportUnmatchedIgnoredErrors: true diff --git a/psalm.xml b/psalm.xml index 14a3bd7512..d38c571912 100644 --- a/psalm.xml +++ b/psalm.xml @@ -2,7 +2,6 @@ - + + + + + + - - @@ -38,5 +40,15 @@ + + + + + + + + + + diff --git a/public/index.php b/public/index.php index 3586eb98dc..5c7851b62a 100644 --- a/public/index.php +++ b/public/index.php @@ -1,5 +1,7 @@ load('../.env.test'); +(new Dotenv())->load('../.env.test'); if (file_exists('../.env.test.local')) { - (new Dotenv(true))->load('../.env.test.local'); + (new Dotenv())->load('../.env.test.local'); } $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);