@@ -190,7 +190,7 @@ public function populate(array $values, bool $overrideExistingVars = false): voi
190190 $ loadedVars = array_flip (explode (', ' , $ _SERVER ['SYMFONY_DOTENV_VARS ' ] ?? $ _ENV ['SYMFONY_DOTENV_VARS ' ] ?? '' ));
191191
192192 foreach ($ values as $ name => $ value ) {
193- $ notHttpName = 0 !== strpos ($ name , 'HTTP_ ' );
193+ $ notHttpName = ! str_starts_with ($ name , 'HTTP_ ' );
194194 // don't check existence with getenv() because of thread safety issues
195195 if (!isset ($ loadedVars [$ name ]) && (!$ overrideExistingVars && (isset ($ _ENV [$ name ]) || (isset ($ _SERVER [$ name ]) && $ notHttpName )))) {
196196 continue ;
@@ -427,7 +427,7 @@ private function skipEmptyLines()
427427
428428 private function resolveCommands (string $ value , array $ loadedVars ): string
429429 {
430- if (false === strpos ($ value , '$ ' )) {
430+ if (! str_contains ($ value , '$ ' )) {
431431 return $ value ;
432432 }
433433
@@ -463,7 +463,7 @@ private function resolveCommands(string $value, array $loadedVars): string
463463
464464 $ env = [];
465465 foreach ($ this ->values as $ name => $ value ) {
466- if (isset ($ loadedVars [$ name ]) || (!isset ($ _ENV [$ name ]) && !(isset ($ _SERVER [$ name ]) && 0 !== strpos ($ name , 'HTTP_ ' )))) {
466+ if (isset ($ loadedVars [$ name ]) || (!isset ($ _ENV [$ name ]) && !(isset ($ _SERVER [$ name ]) && ! str_starts_with ($ name , 'HTTP_ ' )))) {
467467 $ env [$ name ] = $ value ;
468468 }
469469 }
@@ -481,7 +481,7 @@ private function resolveCommands(string $value, array $loadedVars): string
481481
482482 private function resolveVariables (string $ value , array $ loadedVars ): string
483483 {
484- if (false === strpos ($ value , '$ ' )) {
484+ if (! str_contains ($ value , '$ ' )) {
485485 return $ value ;
486486 }
487487
@@ -516,7 +516,7 @@ private function resolveVariables(string $value, array $loadedVars): string
516516 $ value = $ this ->values [$ name ];
517517 } elseif (isset ($ _ENV [$ name ])) {
518518 $ value = $ _ENV [$ name ];
519- } elseif (isset ($ _SERVER [$ name ]) && 0 !== strpos ($ name , 'HTTP_ ' )) {
519+ } elseif (isset ($ _SERVER [$ name ]) && ! str_starts_with ($ name , 'HTTP_ ' )) {
520520 $ value = $ _SERVER [$ name ];
521521 } elseif (isset ($ this ->values [$ name ])) {
522522 $ value = $ this ->values [$ name ];
0 commit comments