8000 Fix 'Cannot access parent:: when current class scope has no parent' error by Androbin · Pull Request #40774 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Fix 'Cannot access parent:: when current class scope has no parent' error #40774

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

Closed
wants to merge 1 commit into from
Closed
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
5EF9
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,15 @@ private function generateSignature(\ReflectionClass $class): iterable
continue;
}

if (!$p->isDefaultValueConstant() || \defined($p->getDefaultValueConstantName())) {
$defaultValueConstantName = preg_replace('/^parent::/', 'pimax\Messages\Message::', $p->getDefaultValueConstantName());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Harcoding "pimax" in the source code of Symfony doesn't make sense.
Maybe you can provide us with a reproducer? Or better, a failing test case?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that the name of the type of $m?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry I don't understand, there is no $m on this line.


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

continue;
}

$defaults[$p->name] = $p->getDefaultValueConstantName();
$defaults[$p->name] = $defaultValueConstantName;
$parametersWithUndefinedConstants[$p->name] = true;
}

Expand Down
0