@@ -155,8 +155,7 @@ public static function setFolderPermissions(string $dir, IOInterface $io): void
155155 };
156156
157157 $ walker = function (string $ dir ) use (&$ walker , $ changePerms ): void {
158- /** @phpstan-ignore-next-line */
159- $ files = array_diff (scandir ($ dir ), ['. ' , '.. ' ]);
158+ $ files = array_diff (scandir ($ dir ) ?: [], ['. ' , '.. ' ]);
160159 foreach ($ files as $ file ) {
161160 $ path = $ dir . '/ ' . $ file ;
162161
@@ -200,8 +199,12 @@ public static function setSecuritySaltInFile(string $dir, IOInterface $io, strin
200199 {
201200 $ config = $ dir . '/config/ ' . $ file ;
202201 $ content = file_get_contents ($ config );
202+ if ($ content === false ) {
203+ $ io ->write ('Config file not readable or not found: config/ ' . $ file );
204+
205+ return ;
206+ }
203207
204- /** @phpstan-ignore-next-line */
205208 $ content = str_replace ('__SALT__ ' , $ newKey , $ content , $ count );
206209
207210 if ($ count == 0 ) {
@@ -232,7 +235,12 @@ public static function setAppNameInFile(string $dir, IOInterface $io, string $ap
232235 {
233236 $ config = $ dir . '/config/ ' . $ file ;
234237 $ content = file_get_contents ($ config );
235- /** @phpstan-ignore-next-line */
238+ if ($ content === false ) {
239+ $ io ->write ('Config file not readable or not found: config/ ' . $ file );
240+
241+ return ;
242+ }
243+
236244 $ content = str_replace ('__APP_NAME__ ' , $ appName , $ content , $ count );
237245
238246 if ($ count == 0 ) {
0 commit comments