You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
27
+
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:
28
28
29
29
```php
30
30
private ?SomeType $someType = null;
@@ -79,6 +79,35 @@ $id = $article->getId();
79
79
80
80
<br>
81
81
82
+
Last rule checks that all interface implementations follow the same method signature as the interface:
83
+
84
+
```php
85
+
interface SomeInterface
86
+
{
87
+
public function doSomething(int $value): void;
88
+
}
89
+
90
+
final class SomeClass implements SomeInterface
91
+
{
92
+
public function doSomething($value): void { // ... }
93
+
}
94
+
```
95
+
96
+
:no_good:
97
+
98
+
↓
99
+
100
+
```php
101
+
final class SomeClass implements SomeInterface
102
+
{
103
+
public function doSomething(int $value): void { // ... }
104
+
}
105
+
```
106
+
107
+
:heavy_check_mark:
108
+
109
+
<br>
110
+
82
111
## Configure
83
112
84
113
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.
0 commit comments