Skip to content

Commit 16cc5d8

Browse files
committed
Update for new Psalm version
1 parent 8102980 commit 16cc5d8

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/Context/ProcessContext.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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',

src/Worker/Internal/ContextWorker.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ public function submit(Task $task, ?Cancellation $cancellation = null): Executio
173173
throw $exception;
174174
}
175175

176+
/** @psalm-suppress TypeDoesNotContainType https://github.com/vimeo/psalm/issues/10608 */
176177
if ($cancellation) {
177178
$context = $this->context;
178179
$cancellationId = $cancellation->subscribe(static fn () => async(

0 commit comments

Comments
 (0)