Repository navigation
[v6] #143 - Narrow nullable native types, improve PHPStan level to 8 - #253
Draft
njoubert-cleverage wants to merge 1 commit into
Draft
njoubert-cleverage wants to merge 1 commit into
njoubert-cleverage wants to merge 1 commit into
Conversation
…stractConfigurableTask::getOptions() and ProcessState::getContextualizedOptions() return array, CsvResource::$lineNumber and ProcessHistory::$startDate are not nullable. Improve PHPStan level from 7 to 8 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Refs #143. To be merged for v6.0 only (breaking change): this PR is a draft, attached to the v6.0 milestone. It must be released together with cleverage/archive-process-bundle (see the linked PR below).
Step 3 of #143: the 16 remaining level 8 errors all come from native nullable types that are never
nullin practice. PHPStan keeps thenullof the native type even with a stricter PHPDoc, so the native types are narrowed:AbstractConfigurableTask::getOptions(): array(was?array): options are always resolved when read;ProcessState::getContextualizedOptions(): array(was?array): always computed when read;CsvResource::$lineNumberis anint(was?int, initialized to1);ProcessHistory::$startDateis a\DateTimeInterface(was nullable, set in the constructor).phpstan.neongoes from level 7 to level 8 (no ignore). Levels 9 and 10 are out of scope of this PR.PHPStan (level 8, no ignore), PHPUnit, PHP-CS-Fixer and Rector pass.
Linked PR
UnzipTaskandZipTaskoverridegetOptions(): ?array, which is a fatal error with this PR. The corrective PR (milestone v2.3) declares anarrayreturn type, compatible with both process-bundle v5 and v6: archive v2.3 must be released before process-bundle v6.0.Requirements
getOptions()overrides must return anarray)Breaking changes
AbstractConfigurableTask::getOptions()declaring a?arrayreturn type, or ofProcessState::getContextualizedOptions(), fail with a fatal error; they must declarearray.CsvResource::$lineNumberorProcessHistory::$startDatewith a nullable type fail with a fatal error.🤖 Generated with Claude Code