kubawerlos / types-checker
A tool to find missing type declarations in PHP 7 code
Installs: 41 172
Dependents: 4
Suggesters: 0
Security: 0
Stars: 6
Watchers: 2
Forks: 1
Open Issues: 1
pkg:composer/kubawerlos/types-checker
Requires
- php: ^7.2 || ^8.0
- ext-tokenizer: *
- symfony/console: ^3.4 || ^4.0 || ^5.0 || ^6.0
- symfony/finder: ^3.4 || ^4.0 || ^5.0 || ^6.0
Requires (Dev)
- phpunit/phpunit: ^8.5.2 || ^9.0.1
README
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
| Option | Description |
|---|---|
--autoloader |
Add custom autoloader file |
--exclude |
Exclude class, interface or trait from report |
--skip-return-types |
Do not report missing return types |
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