Skip to content

Require 99 % type coverage - #8222

Merged
TomasVotruba merged 1 commit into
mainfrom
type-coverage-95
Jul 30, 2026
Merged

Require 99 % type coverage#8222
TomasVotruba merged 1 commit into
mainfrom
type-coverage-95

Conversation

@TomasVotruba

@TomasVotruba TomasVotruba commented Jul 30, 2026

Copy link
Copy Markdown
Member

Follow-up to #8221, which brought in tomasvotruba/type-coverage.

Turns on the type_coverage thresholds that ship with it:

+    # see https://github.com/TomasVotruba/type-coverage
+    type_coverage:
+        declare: 99
+        return_type: 99
+        param_type: 99
+        property_type: 99
+        constant_type: 99

PHPStan then fails if any of these drop below 99 %:

Class constant type coverage is 98.0 % out of 738 possible
    Add more class constant types to reach 99 % coverage

Current numbers, measured with type_coverage: measure: true:

metric coverage of
Class constant type 99.7 % 738
Param type 99.9 % 7772
Property type 100.0 % 360
Return type 99.9 % 7449
Strict declares 99.9 % 2766

So this is a floor, not a task list - nothing to fix right now, it only stops the numbers from sliding.

Turn on the tomasvotruba/type-coverage thresholds for return types,
param types, property types, constant types and strict declares.
@TomasVotruba TomasVotruba changed the title Require 95 % type coverage Require 99 % type coverage Jul 30, 2026
@TomasVotruba
TomasVotruba merged commit f6d7133 into main Jul 30, 2026
65 checks passed
@TomasVotruba
TomasVotruba deleted the type-coverage-95 branch July 30, 2026 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant