Skip to content

Commit d8aa0f6

Browse files
committed
require 95 % type coverage
Turn on the tomasvotruba/type-coverage thresholds for return types, param types, property types, constant types and strict declares.
1 parent 82cdd82 commit d8aa0f6

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎CLAUDE.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ vendor/bin/phpunit
3939

4040
PHPStan extras enabled in `phpstan.neon`:
4141
- `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".
42+
- `type_coverage`: at least 95 % of return types, param types, property types, constant types and `declare(strict_types=1)` must be in place.
4243
- `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.
4344
- `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.
4445

‎phpstan.neon‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,14 @@ parameters:
6060
narrow_param: true
6161
narrow_return: true
6262

63+
# see https://github.com/TomasVotruba/type-coverage
64+
type_coverage:
65+
declare: 95
66+
return_type: 95
67+
param_type: 95
68+
property_type: 95
69+
constant_type: 95
70+
6371
# see https://github.com/TomasVotruba/unused-public
6472
unused_public:
6573
methods: true

0 commit comments

Comments
 (0)