Integrate Infection PHPStan checks into CI without a generated PHPStan baseline#168
Open
Integrate Infection PHPStan checks into CI without a generated PHPStan baseline#168
Conversation
Agent-Logs-Url: https://github.com/voku/Arrayy/sessions/fccfdd39-43e1-400b-b2eb-96b78205f968 Co-authored-by: voku <264695+voku@users.noreply.github.com>
Agent-Logs-Url: https://github.com/voku/Arrayy/sessions/fccfdd39-43e1-400b-b2eb-96b78205f968 Co-authored-by: voku <264695+voku@users.noreply.github.com>
Agent-Logs-Url: https://github.com/voku/Arrayy/sessions/fccfdd39-43e1-400b-b2eb-96b78205f968 Co-authored-by: voku <264695+voku@users.noreply.github.com>
Agent-Logs-Url: https://github.com/voku/Arrayy/sessions/e9e761a8-a4d9-4225-8bd9-aa6c6ff8adbf Co-authored-by: voku <264695+voku@users.noreply.github.com>
|
Owner
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request focuses on improving static analysis and type safety using PHPStan. Key changes include the introduction of a dedicated PHPStan configuration for fixtures, extensive updates to PHPDoc annotations for better type coverage (especially in Json.php), and the removal of unused properties in TypeCheckPhpDoc.php. Additionally, logic was added to handle non-traversable objects in the JSON mapper and to verify class existence before mapping. I have no feedback to provide.
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.



This change adds Infection's PHPStan-backed static-analysis pass to CI on a supported PHP version and keeps the workflow green without committing a generated 2k+ line baseline. The repo-wide PHPStan pass is now scoped to production code, while the dedicated PHPStan fixture coverage remains separate.
CI / static-analysis integration
staticAnalysisTool: "phpstan"integration.PHPStan scope cleanup
phpstan-baseline.neon.phpstan.neonpass to analyzesrc/only.phpstan-fixtures.neonso test fixtures still validate expected type behavior.Targeted PHPStan debt reduction
Json,AbstractCollection,Create,DetectFirstValueTypeCollection,TypeCheckCallback, andTypeCheckPhpDoc.src/Arrayy.phpand the PHPStan runtime-reflection extension.Typing improvements
Example of the CI/static-analysis wiring:
{ "phpUnit": { "customPath": "vendor/bin/phpunit" }, "staticAnalysisTool": "phpstan" }This change is