Skip to content

3.x: Fix phpstan up to level 10 - #82

Merged
acoulton merged 11 commits into
3.x-phpstan-l9from
3.x-phpstan-l10
Oct 27, 2026
Merged

acoulton merged 11 commits into
3.x-phpstan-l9from
3.x-phpstan-l10

Conversation

@acoulton

Copy link
Copy Markdown
Member

No description provided.

The CSVWriter isn't currently final, so theoretically a child could
modify the BOM constant to a non-string.
Ensure that the returned data structure has the expected format and the
data is valid.
AbstractArrayRepository should not make so many assumptions about the
incoming data.
Only count the lock as having been successful if we get an explicit `1`
or `'1'` result. Previously we assumed it would always be one of these,
but theoretically in an error condition we could get a value that can't
properly cast to int which would have caused an error.
AssociativeArrayUtils::deepMerge will in practice return:
* array<string, mixed> if all inputs were array<string, mixed>
* array<mixed> if *any* input had numeric keys

There is no easy way to report that to PHPStan (conditional return
types don't cater for variadics) so we need to just tag the resultant
variable.
There were a couple of phpstan errors coming up related to the class
having potentially conflicting types in a child. In practice this never
needs to be extended so we can safely just finalise it which solves all
those issues.
@acoulton

Copy link
Copy Markdown
Member Author

@craig410 I think that's all of these PRs now green and good to go if you're happy with them? I haven't done much CHANGELOG yet but can do that separately when we're ready to release.

@acoulton
acoulton merged commit 5bdbd1f into 3.x Oct 27, 2026
20 checks passed
@acoulton
acoulton deleted the 3.x-phpstan-l10 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.

2 participants