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:
parent
11f170acb4
commit
03ab279cc4
@ -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;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
Loading…
Reference in New Issue
Block a user