@@ -35,10 +35,10 @@ final class ProcessContext extends AbstractContext
3535 "xdebug.client_host " => "localhost " ,
3636 ];
3737
38- /** @var string|null External version of SCRIPT_PATH if inside a PHAR. */
38+ /** @var non-empty- string|null External version of SCRIPT_PATH if inside a PHAR. */
3939 private static ?string $ pharScriptPath = null ;
4040
41- /** @var string|null PHAR path with a '.phar' extension. */
41+ /** @var non-empty- string|null PHAR path with a '.phar' extension. */
4242 private static ?string $ pharCopy = null ;
4343
4444 /** @var non-empty-list<string>|null Cached path to located PHP binary. */
@@ -97,7 +97,7 @@ public static function start(
9797 // Write process runner to external file if inside a PHAR,
9898 // because PHP can't open files inside a PHAR directly except for the stub.
9999 if (\str_starts_with (self ::SCRIPT_PATH , "phar:// " )) {
100- if (self ::$ pharScriptPath ) {
100+ if (self ::$ pharScriptPath !== null ) {
101101 $ scriptPath = self ::$ pharScriptPath ;
102102 } else {
103103 $ path = \dirname (self ::SCRIPT_PATH );
@@ -107,7 +107,7 @@ public static function start(
107107 \copy (\Phar::running (false ), self ::$ pharCopy );
108108
109109 \register_shutdown_function (static function (): void {
110- if (self ::$ pharCopy ) {
110+ if (self ::$ pharCopy !== null ) {
111111 @\unlink (self ::$ pharCopy );
112112 }
113113 });
@@ -122,7 +122,7 @@ public static function start(
122122 \file_put_contents ($ scriptPath , $ contents );
123123
124124 \register_shutdown_function (static function (): void {
125- if (self ::$ pharScriptPath ) {
125+ if (self ::$ pharScriptPath !== null ) {
126126 @\unlink (self ::$ pharScriptPath );
127127 }
128128 });
@@ -189,6 +189,7 @@ private static function locateBinary(): array
189189
190190 $ executable = \PHP_OS_FAMILY === 'Windows ' ? "php.exe " : "php " ;
191191
192+ /** @psalm-suppress RiskyTruthyFalsyComparison */
192193 $ paths = \array_filter (\explode (
193194 \PATH_SEPARATOR ,
194195 \getenv ('PATH ' ) ?: '/usr/bin ' . \PATH_SEPARATOR . '/usr/local/bin ' ,
0 commit comments