Skip to content

Commit 2e051ec

Browse files
committed
Add phpBinary to DebugServer options array shape
PHPStan flagged the new $this->options['phpBinary'] ?? '' lookup because the @param array shape on DebugServer::__construct didn't declare `phpBinary`. Without the shape entry PHPStan inferred the offset as absent and folded the ?? '' to a literal '', triggering both an "offset does not exist" error and a "strict comparison '' !== '' always false" follow-up at each of the two new call sites. Add `phpBinary?: string` to the array shape so PHPStan agrees with the runtime behavior. No code change.
1 parent 112151f commit 2e051ec

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/DebugServer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ final class DebugServer
166166
/** @var array{id: string, label: string, file: string, line: int, condition?: string}|null */
167167
private array|null $activeBreakpoint = null;
168168

169-
/** @param array{command?: list<string>, context?: string, breakpoint?: string, steps?: int, connectionTimeout?: float, executionTimeout?: float, traceOnly?: bool, maxSteps?: int, jsonOutput?: bool, breakpoints?: list<array{file: string, line: int|string, condition?: string}>, readTimeout?: float, watches?: list<string>, pretty?: bool, maxValueBytes?: int|null, maxDepth?: int|null} $options */
169+
/** @param array{command?: list<string>, context?: string, breakpoint?: string, steps?: int, connectionTimeout?: float, executionTimeout?: float, traceOnly?: bool, maxSteps?: int, jsonOutput?: bool, breakpoints?: list<array{file: string, line: int|string, condition?: string}>, readTimeout?: float, watches?: list<string>, pretty?: bool, maxValueBytes?: int|null, maxDepth?: int|null, phpBinary?: string} $options */
170170
public function __construct(
171171
private readonly string $targetScript,
172172
private readonly int $debugPort,

0 commit comments

Comments
 (0)