Reduce PHPStan baseline by addressing actual issues#1083
Open
dereuromark wants to merge 2 commits into5.xfrom
Open
Reduce PHPStan baseline by addressing actual issues#1083dereuromark wants to merge 2 commits into5.xfrom
dereuromark wants to merge 2 commits into5.xfrom
Conversation
Remove 13 stale baseline entries by fixing the underlying issues: - BakeSeedCommand: drop wrong @var annotation, cast option value; rewrite reference foreach to track removable keys explicitly - AbstractAdapter: tighten generateBulkInsertSql @param type and cast keys to string for array_map - AdapterFactory: declare final constructor (allows safe new static) - MysqlAdapter: drop redundant nested isset() checks - Environment: useTransactions() is on the interface, drop the dead method_exists guard; gate up()/down() dispatch with method_exists - Manager: cast strpos result, fall back to 0 in max() - TableFinder: drop redundant isset checks on always-set list keys - MigrationHelper: rewrite as if/else so PHPStan can narrow the type Two entries remain in the baseline: - Index::setUnique dynamic dispatch (handled via continue) - SqliteAdapter null check kept for test mock compatibility
Match parent visibility on inherited buildOptionParser overrides, type the closure parameter, simplify if/else to ternary, and add the newline rector wants.
This was referenced May 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.
Summary
Removes 13 of 15 stale entries from
phpstan-baseline.neonby fixing the underlying issues. All non-BC; remaining 2 entries kept in baseline.Fixes applied
@varannotation, cast option value; rewrite reference foreach to track removable keys explicitly so PHPStan can follow the flow.@paramtype to array<int, array<string, mixed>> and cast keys to string for array_map.Remaining baseline entries
Index::setUniquedynamic dispatch — early continue handles unique, but PHPStan can't track it.SqliteAdapternull check on query result — required for test mocks where the mocked method returns null.BC concerns deferred
up(): void/down(): voidtoMigrationInterfacewould clear the remaining method.notFound entries onEnvironmentbut is a BC break for third parties implementing the interface directly. Suggest 6.x.