Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Type Coverage Laravel Package

tomasvotruba/type-coverage

PHPStan extension that measures and enforces a minimum type declaration coverage rate across your properties, params, and return types. Set per-category thresholds in phpstan.neon and raise them gradually, making it easy to adopt even on legacy projects.

View on GitHub
Deep Wiki
Context7
2.5.1

What's Changed

  • Skip array dim fetch callers in NoMixedMethodCallerRule (#102)
  • Drop dead print_suggestions default and duplicate coverage count (#100)
2.3.0

Type Perfect rules are now part of this package

rector/type-perfect has been merged into tomasvotruba/type-coverage (#68). Its rules live in packages/type-perfect and keep the Rector\TypePerfect\ namespace, so existing ignoreErrors patterns still match.

The extension is registered automatically via phpstan/extension-installer — no extra includes needed.

If you use both packages, drop rector/type-perfect from composer.json to avoid duplicate rules:

 "require-dev": {
     "tomasvotruba/type-coverage": "^2.3",
-    "rector/type-perfect": "^2.1"
 }

All Type Perfect rules are opt-in

Four rules used to report right after install, with no way off short of ignoreErrors. They now match the rest of the set — off by default, one parameter each (#69):

 parameters:
     type_perfect:
         narrow_param: false
         narrow_return: false
         no_mixed: false
         null_over_false: false
+        no_param_type_removal: false
+        no_array_access_on_object: false
+        no_isset_on_object: false
+        no_empty_on_object: false

Enable what you want:

parameters:
    type_perfect:
        narrow_param: true
        narrow_return: true
        no_mixed_property: true
        no_mixed_caller: true
        null_over_false: true
        no_param_type_removal: true
        no_array_access_on_object: true
        no_isset_on_object: true
        no_empty_on_object: true

What each of those 4 catches:

// no_isset_on_object / no_empty_on_object
if (isset($object->property)) { }   // bad - hides typos and nulls
if ($object->property !== null) { } // good

// no_array_access_on_object
$object['key'];       // bad
$object->getKey();    // good

// no_param_type_removal
public function run(string $name)  // parent
public function run($name)         // bad - child drops the type

Type coverage checks are unchanged

return_type, param_type, property_type and constant_type behave exactly as in 2.2.2 — upgrading adds rules, it does not change existing measurements.

Housekeeping

  • symfony/dom-crawler bumped to ^8.1 (dev only) (#70)

Full Changelog: https://github.com/TomasVotruba/type-coverage/compare/2.2.2...2.3.0

2.1.0

New features and Changes :partying_face:

  • PHP 8.5 support added

Full Changelog: https://github.com/TomasVotruba/type-coverage/compare/2.0.2...2.1.0

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo