diff --git a/README.md b/README.md index 90bfe8e0..e575f27f 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ composer require rector/type-perfect --dev
-There are 2 checks enabled out of the box. First one makes sure we don't miss a chance to use `instanceof` to make further code know about exact object type: +There are 3 checks enabled out of the box. First one makes sure we don't miss a chance to use `instanceof` to make further code know about exact object type: ```php private ?SomeType $someType = null; @@ -79,6 +79,35 @@ $id = $article->getId();
+Last rule checks that all interface implementations follow the same method signature as the interface: + +```php +interface SomeInterface +{ + public function doSomething(int $value): void; +} + +final class SomeClass implements SomeInterface +{ + public function doSomething($value): void { // ... } +} +``` + +:no_good: + +↓ + +```php +final class SomeClass implements SomeInterface +{ + public function doSomething(int $value): void { // ... } +} +``` + +:heavy_check_mark: + +
+ ## Configure Next rules you can enable by configuration. We take them from the simplest to more powerful, in the same order we apply them on legacy projects.