Skip to content

#143 - Remove all PHPStan ignores at level 6 - #238

Merged
njoubert-cleverage merged 1 commit into
mainfrom
143
Oct 9, 2026
Merged

njoubert-cleverage merged 1 commit into
mainfrom
143

Conversation

@njoubert-cleverage

Copy link
Copy Markdown
Member

Description

Refs #143 (step 1 of 3: levels 7-8, then 9-10 will follow in separate PRs, so the issue stays open).

phpstan.neon hid 219 level 6 errors behind 9 ignoreErrors patterns, with reportUnmatchedIgnoredErrors: false masking the ones that no longer matched anything. This PR keeps level 6 and removes every ignore:

  • remove all ignoreErrors and reportUnmatchedIgnoredErrors: false from phpstan.neon;
  • add the missing iterable value types and generic types in PHPDoc (no native signature change): options and contexts as array<string, mixed> (TransformerInterface::transform() and all its implementations, ProcessState, ProcessManager, events, logger processors…), task codes as list<string> in ProcessConfiguration / TaskConfiguration, \SplQueue<…>, Options<array<string, mixed>>, array<string, \Closure> for normalized transformers, CSV headers and lines;
  • remove the 2 @phpstan-ignore-next-line: the one in ProcessLauncherTask was no longer needed, the one in AbstractIterableOutputTask hid an unreachable check ($iterator is a ?\Iterator, it is always null at this point);
  • InputAggregatorTask: remove the always-false !$previousState->getTaskConfiguration() check (non-nullable return type);
  • fix InputIteratorTask: an \IteratorAggregate input whose getIterator() does not return an \Iterator (e.g. another \IteratorAggregate) failed with a TypeError; it is now wrapped in an \IteratorIterator. Add InputIteratorTaskTest, precise the reference documentation.

On main, only the nested IteratorAggregate test fails (TypeError). PHPStan (level 6, no ignore), PHPUnit (255 tests), PHP-CS-Fixer and Rector pass.

Requirements

  • Documentation updates
    • Reference
    • Cookbooks
    • Changelog
  • Unit tests

Breaking changes

None: only PHPDoc is added, native signatures are unchanged. Projects analysing their own code extending these classes with PHPStan may get more precise types.

🤖 Generated with Claude Code

…g iterable value and generic types in PHPDoc, remove unreachable code, fix InputIteratorTask with an IteratorAggregate not returning an Iterator

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@njoubert-cleverage
njoubert-cleverage merged commit ab15ded into main Oct 9, 2026
17 checks passed
@njoubert-cleverage
njoubert-cleverage deleted the 143 branch October 9, 2026 08:33
@njoubert-cleverage njoubert-cleverage mentioned this pull request Oct 9, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant