A tool to find missing type declarations in PHP 7 code.
composer require --dev kubawerlos/types-checker
vendor/bin/types-checker src tests
Option | Description |
---|---|
--autoloader |
Add custom autoloader file |
--exclude |
Exclude class, interface or trait from report |
--skip-return-types |
Do not report missing return types |
<?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