Menu

Static Analysis Gates: PHPStan, TypeScript Strict & Coverage in CI
πŸ“°

Static Analysis Gates: PHPStan, TypeScript Strict & Coverage in CI

DEV Community: phpΒ·Muhammad Ali MughalΒ·about 2 hours ago
#D7Q0Umuk
#devto#dev#baseline#phpstan#coverage
Reading 0:00
15s threshold

A client's Laravel team asked me why their AI-assisted pull requests kept passing review and then failing in production. One example: a generated service method returned ?Order and the controller called $order->total without a null check. Tests covered the happy path only. The reviewer skimmed 400 lines of plausible code and approved it. PHPStan at level 6 would have flagged that exact line in under a second. They had PHPStan installed, but nobody ran it in CI because the first run produced 1,800 errors and the team gave up.

I wrote this with help from AI tools and checked every config against PHPStan 2.x, Larastan 3, TypeScript 5.6, Vitest 2 and GitHub Actions.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.