File tree Expand file tree Collapse file tree 9 files changed +53
-25
lines changed
Expand file tree Collapse file tree 9 files changed +53
-25
lines changed Original file line number Diff line number Diff line change 9090 "symfony/phpunit-bridge" : " 6.4.*" ,
9191 "symfony/stopwatch" : " 6.4.*" ,
9292 "symfony/web-profiler-bundle" : " 6.4.*" ,
93- "vimeo/psalm" : " 5.23 .*" ,
93+ "vimeo/psalm" : " 5.24 .*" ,
9494 "wapmorgan/php-deprecation-detector" : " 2.0.*" ,
9595 "textalk/websocket" : " 1.5.8.*"
9696 },
Original file line number Diff line number Diff line change 11<?php
22
3+ declare (strict_types=1 );
4+
35use Symfony \Component \Dotenv \Dotenv ;
46
57require dirname (__DIR__ ).'/vendor/autoload.php ' ;
1113// Load cached env vars if the .env.local.php file exists
1214// Run "composer dump-env prod" to create it (requires symfony/flex >=1.2)
1315if (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 ' ])) {
14- (new Dotenv ())->usePutenv (true )->populate ($ env );
16+ (new Dotenv ())->usePutenv ()->populate ($ env );
1517} else {
1618 // load all the .env files
17- (new Dotenv ())->usePutenv (true )->loadEnv (dirname (__DIR__ ).'/.env ' );
19+ (new Dotenv ())->usePutenv ()->loadEnv (dirname (__DIR__ ).'/.env ' );
1820}
1921
2022$ _SERVER += $ _ENV ;
Original file line number Diff line number Diff line change 1515 $ routingConfigurator ->add ('apple_login ' , '/login/check-apple ' );
1616
1717 $ routingConfigurator ->add ('gesdinet_jwt_refresh_token ' , '/api/authentication/refresh ' )
18- ->controller (App \Api \Services \Authentication \JWTTokenRefreshService::class. ' :: refresh ' )
18+ ->controller ([ App \Api \Services \Authentication \JWTTokenRefreshService::class, ' refresh '] )
1919 ;
2020
2121 $ routingConfigurator ->import ('@OpenAPIServerBundle/Resources/config/routing.yaml ' )
Original file line number Diff line number Diff line change @@ -152,6 +152,12 @@ function loadEnvVariables(string $filename): void
152152 run ('bin/console doctrine:migrations:rollup -n ' );
153153});
154154
155+ // dump the .env file as .env.local.php to speed up the loading of the env vars
156+ task ('dump:env ' , function () {
157+ cd ('{{release_path}} ' );
158+ run ('composer dump-env prod ' );
159+ });
160+
155161/*
156162 * Main task
157163 */
@@ -161,6 +167,7 @@ function loadEnvVariables(string $filename): void
161167 'deploy:clear_paths ' ,
162168 'deploy:vendors ' ,
163169 'install:assets ' ,
170+ 'dump:env ' ,
164171 'deploy:cache:clear ' ,
165172 'deploy:writable ' ,
166173 'deploy:symlink ' ,
Original file line number Diff line number Diff line change @@ -5,9 +5,12 @@ parameters:
55 - config/bootstrap_test.php
66 level : 6 # 0 is the loosest lvl and 9 is the strictest (https://phpstan.org/user-guide/rule-levels)
77 paths :
8- - src
9- - config
10- - tests
8+ - . # Analyze all directories in the project
9+ excludePaths :
10+ - node_modules/**/*
11+ - var/**/*
12+ - vendor/**/*
13+ - deploy.php
1114 inferPrivatePropertyTypeFromConstructor : true
1215 reportUnmatchedIgnoredErrors : true
1316
Original file line number Diff line number Diff line change 22<!-- 1 is the highest and 8 the lowest error level -->
33<psalm
44 errorLevel =" 4"
5- resolveFromConfigFile =" true"
65 xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
76 xmlns =" https://getpsalm.org/schema/config"
87 xsi : schemaLocation =" https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
98 findUnusedBaselineEntry =" true"
109 findUnusedCode =" false"
1110>
1211 <projectFiles >
13- <directory name =" src " />
12+ <directory name =" bin " />
1413 <directory name =" config" />
14+ <directory name =" migrations" />
15+ <directory name =" public" />
16+ <directory name =" src" />
17+ <directory name =" templates" />
1518 <directory name =" tests" />
19+ <directory name =" translations" />
1620 <ignoreFiles >
1721 <directory name =" vendor" />
1822 <!-- Legacy code that will be removed in the future -->
1923 <directory name =" src/Project/CatrobatCode" />
20- <file name =" config/bootstrap.php" />
21- <file name =" config/preload.php" />
2224 </ignoreFiles >
2325 </projectFiles >
2426
3840 <directory name =" tests" />
3941 </errorLevel >
4042 </InternalMethod >
43+ <MissingFile >
44+ <errorLevel type =" info" >
45+ <file name =" config/bootstrap.php" />
46+ </errorLevel >
47+ </MissingFile >
48+ <InvalidArgument >
49+ <errorLevel type =" info" >
50+ <file name =" config/routes.php" />
51+ </errorLevel >
52+ </InvalidArgument >
4153 </issueHandlers >
4254</psalm >
Original file line number Diff line number Diff line change 11<?php
22
3+ declare (strict_types=1 );
4+
35use App \Kernel ;
46use Symfony \Component \ErrorHandler \Debug ;
57use Symfony \Component \HttpFoundation \Request ;
Original file line number Diff line number Diff line change 11<?php
22
3+ declare (strict_types=1 );
4+
35// This file is just a copy of index.php with new Kernel(env="test", debug=false) hardcoded
46// There is no better solution right now than changing the APP_ENV value in the .env file
57// or using this copied file. Else tests like behat may use the test config and initialize
2729 Request::setTrustedHosts ([$ trustedHosts ]);
2830}
2931
30- (new Dotenv (true ))->load ('../.env.test ' );
32+ (new Dotenv ())->load ('../.env.test ' );
3133if (file_exists ('../.env.test.local ' )) {
32- (new Dotenv (true ))->load ('../.env.test.local ' );
34+ (new Dotenv ())->load ('../.env.test.local ' );
3335}
3436
3537$ kernel = new Kernel ($ _SERVER ['APP_ENV ' ], (bool ) $ _SERVER ['APP_DEBUG ' ]);
You can’t perform that action at this time.
0 commit comments