From cc83ab0fc310d46a3848f7cbe99382cf4f9e7af1 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Thu, 30 Jul 2026 11:53:27 +0200 Subject: [PATCH] require 99 % type coverage Turn on the tomasvotruba/type-coverage thresholds for return types, param types, property types, constant types and strict declares. --- CLAUDE.md | 1 + phpstan.neon | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CLAUDE.md b/CLAUDE.md index 822d0648eed..7f0f45bbeae 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -39,6 +39,7 @@ vendor/bin/phpunit PHPStan extras enabled in `phpstan.neon`: - `type-coverage` (ships the former `type-perfect` rules): `no_mixed`, `null_over_false`, `narrow_param`, `narrow_return` — return/param types must be narrow; prefer `null` over `false` for "no result". +- `type_coverage`: at least 99 % of return types, param types, property types, constant types and `declare(strict_types=1)` must be in place. - `unused-public`: public methods/properties/constants must be used somewhere. If you add a new public API, expect to use it or mark it accordingly. - `symplify/phpstan-rules` + `rector-rules`: forbids `var_dump`, `dd`, `property_exists`, `class_exists`, `@` error suppression, dynamic names, etc., outside the narrowly listed exceptions in `phpstan.neon`. Do not add new exceptions casually — fix the code. diff --git a/phpstan.neon b/phpstan.neon index 071ff24a49b..5c29f57580e 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -60,6 +60,14 @@ parameters: narrow_param: true narrow_return: true + # see https://github.com/TomasVotruba/type-coverage + type_coverage: + declare: 99 + return_type: 99 + param_type: 99 + property_type: 99 + constant_type: 99 + # see https://github.com/TomasVotruba/unused-public unused_public: methods: true