kubawerlos/types-checker

A tool to find missing type declarations in PHP 7 code

v2.2.0 2021-12-17 17:11 UTC

This package is auto-updated.

Last update: 2024-12-06 01:36:57 UTC


README

Latest Stable Version PHP version CI Status Code coverage Psalm type coverage

A tool to find missing type declarations in PHP 7 code.

Installation

composer require --dev kubawerlos/types-checker

Usage

vendor/bin/types-checker src tests

Configuration

Example

<?php

interface Foo
{
    public function baz();
}

class Bar
{
    public function baz($x): array
    {
    }

    public function qux(bool $b, $x)
    {
    }
}
Types checker - 2 items checked:
 - 1 class
 - 1 interface

Issues found:
 - Interface Foo:
   - baz:
     - missing return type
 - Class Bar:
   - baz:
     - parameter $x is missing type
   - qux:
     - missing return type
     - parameter $x is missing type

  4 issues