@@ -135,7 +135,7 @@ public function populate(array $values, bool $overrideExistingVars = false): voi
135135 $ loadedVars = array_flip (explode (', ' , $ _SERVER ['SYMFONY_DOTENV_VARS ' ] ?? $ _ENV ['SYMFONY_DOTENV_VARS ' ] ?? '' ));
136136
137137 foreach ($ values as $ name => $ value ) {
138- $ notHttpName = 0 !== strpos ($ name , 'HTTP_ ' );
138+ $ notHttpName = ! str_starts_with ($ name , 'HTTP_ ' );
139139 // don't check existence with getenv() because of thread safety issues
140140 if (!isset ($ loadedVars [$ name ]) && (!$ overrideExistingVars && (isset ($ _ENV [$ name ]) || (isset ($ _SERVER [$ name ]) && $ notHttpName )))) {
141141 continue ;
@@ -372,7 +372,7 @@ private function skipEmptyLines()
372372
373373 private function resolveCommands (string $ value , array $ loadedVars ): string
374374 {
375- if (false === strpos ($ value , '$ ' )) {
375+ if (! str_contains ($ value , '$ ' )) {
376376 return $ value ;
377377 }
378378
@@ -408,7 +408,7 @@ private function resolveCommands(string $value, array $loadedVars): string
408408
409409 $ env = [];
410410 foreach ($ this ->values as $ name => $ value ) {
411- if (isset ($ loadedVars [$ name ]) || (!isset ($ _ENV [$ name ]) && !(isset ($ _SERVER [$ name ]) && 0 !== strpos ($ name , 'HTTP_ ' )))) {
411+ if (isset ($ loadedVars [$ name ]) || (!isset ($ _ENV [$ name ]) && !(isset ($ _SERVER [$ name ]) && ! str_starts_with ($ name , 'HTTP_ ' )))) {
412412 $ env [$ name ] = $ value ;
413413 }
414414 }
@@ -426,7 +426,7 @@ private function resolveCommands(string $value, array $loadedVars): string
426426
427427 private function resolveVariables (string $ value , array $ loadedVars ): string
428428 {
429- if (false === strpos ($ value , '$ ' )) {
429+ if (! str_contains ($ value , '$ ' )) {
430430 return $ value ;
431431 }
432432
@@ -461,7 +461,7 @@ private function resolveVariables(string $value, array $loadedVars): string
461461 $ value = $ this ->values [$ name ];
462462 } elseif (isset ($ _ENV [$ name ])) {
463463 $ value = $ _ENV [$ name ];
464- } elseif (isset ($ _SERVER [$ name ]) && 0 !== strpos ($ name , 'HTTP_ ' )) {
464+ } elseif (isset ($ _SERVER [$ name ]) && ! str_starts_with ($ name , 'HTTP_ ' )) {
465465 $ value = $ _SERVER [$ name ];
466466 } elseif (isset ($ this ->values [$ name ])) {
467467 $ value = $ this ->values [$ name ];
0 commit comments