1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-30 04:39:00 +01:00

Add ParamNameMismatch fixing documentation

This commit is contained in:
Brown 2020-08-17 11:57:27 -04:00
parent 11f170acb4
commit 03ab279cc4

View File

@ -579,3 +579,39 @@ function foo() : string {
$a = foo();
```
### ParamNameMismatch
This aligns child class param names with their parent.
Running `vendor/bin/psalter --issues=ParamNameMismatch` on
```php
<?php
class A {
public function foo(string $str, bool $b = false) : void {}
}
class AChild extends A {
public function foo(string $string, bool $b = false) : void {
echo $string;
}
}
```
gives
```php
<?php
class A {
public function foo(string $str, bool $b = false) : void {}
}
class AChild extends A {
public function foo(string $str, bool $b = false) : void {
echo $str;
}
}
```