-
-
Notifications
You must be signed in to change notification settings - Fork 740
Closed
rectorphp/rector-src
#4833Labels
Description
Bug Report
Rector crashes with PHPStan exception
| Subject | Details |
|---|---|
| Rector version | last dev-main |
| Installed as | composer dependency |
Minimal PHP Code Causing Issue
See https://getrector.com/demo/e913f712-f893-4504-a26d-1e73c3892e0d
<?php
class Foo{
public function baz($default = []) {
return implode('', $default);
}
public function boo($default = '') {
return $default;
}
}
class Bar extends Foo {
public function baz() {
echo parent::baz();
}
public function boo() {
echo parent::boo();
}
}Responsible rules
AddParamBasedOnParentClassMethodRector
Expected Behavior
It should not crash and should produce the following diff:
@@ -11,11 +11,11 @@
}
class Bar extends Foo {
- public function baz() {
+ public function baz($default = []) {
echo parent::baz();
}
- public function boo() {
+ public function boo($default = '') {
echo parent::boo();
}
}Reactions are currently unavailable