Skip to content

Commit

Permalink
Merge pull request #4948 from Catrobat/dependabot/composer/vimeo/psal…
Browse files Browse the repository at this point in the history
…m-5.24.0

Build(deps-dev): Bump vimeo/psalm from 5.23.1 to 5.24.0
  • Loading branch information
dmetzner authored May 25, 2024
2 parents 4e933c9 + ff189ea commit fa9a2eb
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 25 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.*"
},
Expand Down
24 changes: 12 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions config/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use Symfony\Component\Dotenv\Dotenv;

require dirname(__DIR__).'/vendor/autoload.php';
Expand All @@ -11,10 +13,10 @@
// Load cached env vars if the .env.local.php file exists
// Run "composer dump-env prod" to create it (requires symfony/flex >=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;
Expand Down
2 changes: 1 addition & 1 deletion config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
7 changes: 7 additions & 0 deletions deploy.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand All @@ -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',
Expand Down
9 changes: 6 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 16 additions & 4 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@
<!-- 1 is the highest and 8 the lowest error level -->
<psalm
errorLevel="4"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
findUnusedBaselineEntry="true"
findUnusedCode="false"
>
<projectFiles>
<directory name="src" />
<directory name="bin" />
<directory name="config" />
<directory name="migrations" />
<directory name="public" />
<directory name="src" />
<directory name="templates" />
<directory name="tests" />
<directory name="translations" />
<ignoreFiles>
<directory name="vendor" />
<!-- Legacy code that will be removed in the future -->
<directory name="src/Project/CatrobatCode"/>
<file name="config/bootstrap.php" />
<file name="config/preload.php" />
</ignoreFiles>
</projectFiles>

Expand All @@ -38,5 +40,15 @@
<directory name="tests" />
</errorLevel>
</InternalMethod>
<MissingFile>
<errorLevel type="info">
<file name="config/bootstrap.php"/>
</errorLevel>
</MissingFile>
<InvalidArgument>
<errorLevel type="info">
<file name="config/routes.php"/>
</errorLevel>
</InvalidArgument>
</issueHandlers>
</psalm>
2 changes: 2 additions & 0 deletions public/index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use App\Kernel;
use Symfony\Component\ErrorHandler\Debug;
use Symfony\Component\HttpFoundation\Request;
Expand Down
6 changes: 4 additions & 2 deletions public/index_test.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

// This file is just a copy of index.php with new Kernel(env="test", debug=false) hardcoded
// There is no better solution right now than changing the APP_ENV value in the .env file
// or using this copied file. Else tests like behat may use the test config and initialize
Expand Down Expand Up @@ -27,9 +29,9 @@
Request::setTrustedHosts([$trustedHosts]);
}

(new Dotenv(true))->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']);
Expand Down

0 comments on commit fa9a2eb

Please sign in to comment.