Skip to content

3.x: Fix PHPStan issues up to level 6 - #78

Merged
acoulton merged 4 commits into
3.x-phpstan-l5from
3.x-phpstan-l6
Oct 27, 2026
Merged

acoulton merged 4 commits into
3.x-phpstan-l5from
3.x-phpstan-l6

Conversation

@acoulton

Copy link
Copy Markdown
Member

A lot of these were around loose array shapes, or missing method types in tests. There were however a few concrete types that were missing which I've included in a separate commit.

Several of these changes were fixed by Junie, I will give it a proper review.

@acoulton
acoulton added this pull request to stack #71 October 26, 2026 16:24
@acoulton
acoulton requested a review from craig410 October 26, 2026 16:25
Comment thread src/CSV/CSVWriter.php
Comment on lines +35 to 36
/** @var list<array-key>|null */
protected ?array $expect_schema = null;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd kind-of expect the CSV to have string keys for the column headers, but arguably it could validly output numbered columns if the incoming array was a list / integer keys. So it's correct that actually this can be any array-key.

@acoulton acoulton left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all looks ok to me

Add missing property, param and return types - both for
actual things and for arrays etc.
These changes will affect runtime code.
These changes will only affect static analysis.
@acoulton
acoulton merged commit 5bdbd1f into 3.x Oct 27, 2026
10 checks passed
@acoulton
acoulton deleted the 3.x-phpstan-l6 branch October 27, 2026 15:20
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