Integrate Infection PHPStan checks into CI without a generated PHPStan baseline#168
Integrate Infection PHPStan checks into CI without a generated PHPStan baseline#168Copilot wants to merge 10 commits into
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>
|
/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.
|
@copilot do we really need to ignore all this phpstan errors in the config? |
Agent-Logs-Url: https://github.com/voku/Arrayy/sessions/5032dd36-d337-4da8-a49a-056c117b63ff Co-authored-by: voku <264695+voku@users.noreply.github.com>
Agent-Logs-Url: https://github.com/voku/Arrayy/sessions/5032dd36-d337-4da8-a49a-056c117b63ff Co-authored-by: voku <264695+voku@users.noreply.github.com>
Agent-Logs-Url: https://github.com/voku/Arrayy/sessions/5032dd36-d337-4da8-a49a-056c117b63ff Co-authored-by: voku <264695+voku@users.noreply.github.com>
Agent-Logs-Url: https://github.com/voku/Arrayy/sessions/5032dd36-d337-4da8-a49a-056c117b63ff Co-authored-by: voku <264695+voku@users.noreply.github.com>
Agent-Logs-Url: https://github.com/voku/Arrayy/sessions/5032dd36-d337-4da8-a49a-056c117b63ff Co-authored-by: voku <264695+voku@users.noreply.github.com>
Agent-Logs-Url: https://github.com/voku/Arrayy/sessions/5032dd36-d337-4da8-a49a-056c117b63ff Co-authored-by: voku <264695+voku@users.noreply.github.com>
No. I reduced it to a single targeted regex ignore for the recurring internal |
|



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,TypeCheckPhpDoc, andArrayy.Arrayy::create()generic false positive insrc/Arrayy.php.Typing improvements
Example of the CI/static-analysis wiring:
{ "phpUnit": { "customPath": "vendor/bin/phpunit" }, "staticAnalysisTool": "phpstan" }This change is
This change is