Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Config] fix tracking default values that reference the parent class #41767

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ private function generateSignature(\ReflectionClass $class): iterable
}
}

$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) {
Expand All @@ -187,7 +189,7 @@ private function generateSignature(\ReflectionClass $class): iterable
continue;
}

if (!$p->isDefaultValueConstant() || \defined($p->getDefaultValueConstantName())) {
if (!$p->isDefaultValueConstant() || $defined($p->getDefaultValueConstantName())) {
$defaults[$p->name] = $p->getDefaultValue();

continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ public function provideHashedSignature(): iterable

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'); }];
}

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.