[Config] fix tracking default values that reference the parent class
This commit is contained in:
parent
ffb0d2d424
commit
978747e6ea
@ -161,6 +161,8 @@ class ReflectionClassResource implements SelfCheckingResourceInterface
|
||||
}
|
||||
}
|
||||
|
||||
$defined = \Closure::bind(static function ($c) { return \defined($c); }, null, $class->name);
|
||||
|
||||
foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED) as $m) {
|
||||
if (\PHP_VERSION_ID >= 80000) {
|
||||
foreach ($m->getAttributes() as $a) {
|
||||
@ -187,7 +189,7 @@ class ReflectionClassResource implements SelfCheckingResourceInterface
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!$p->isDefaultValueConstant() || \defined($p->getDefaultValueConstantName())) {
|
||||
if (!$p->isDefaultValueConstant() || $defined($p->getDefaultValueConstantName())) {
|
||||
$defaults[$p->name] = $p->getDefaultValue();
|
||||
|
||||
continue;
|
||||
|
@ -164,6 +164,7 @@ EOPHP;
|
||||
|
||||
yield [true, 17, 'public function ccc($bar = 187) {}'];
|
||||
yield [true, 17, 'public function ccc($bar = ANOTHER_ONE_THAT_WILL_NEVER_BE_DEFINED_CCCCCCCCC) {}'];
|
||||
yield [true, 17, 'public function ccc($bar = parent::BOOM) {}'];
|
||||
yield [true, 17, null, static function () { \define('A_CONSTANT_THAT_FOR_SURE_WILL_NEVER_BE_DEFINED_CCCCCC', 'foo'); }];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user