-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Cannot access parent:: when current class scope has no parent #41133
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
Comments
This snippet is easier to understand the issue: namespace AnotherLib {
class Message {
const NOTIFY_REGULAR = "REGULAR";
}
class StructuredMessage extends Message {
public function __construct($notificationType = parent::NOTIFY_REGULAR) {
}
}
}
namespace App {
class MyMessage extends \AnotherLib\StructuredMessage {
}
} Edit: StructedMessage extends Message |
@n0rbyt3 I am not sure how this is related to Symfony. This seems to be invalid PHP code per se: https://3v4l.org/hB7Rr |
@xabbuh Sorry, I missed |
nicolas-grekas
added a commit
that referenced
this issue
Jun 23, 2021
…rent class (nicolas-grekas) This PR was merged into the 4.4 branch. Discussion ---------- [Config] fix tracking default values that reference the parent class | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #41133 | License | MIT | Doc PR | - Commits ------- 978747e [Config] fix tracking default values that reference the parent class
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Symfony version(s) affected: 4.4
Description
If
$p->getDefaultValueConstantName()
starts withparent::
,defined
interprets it relative to the wrong base class.How to reproduce
Minimal reproducing test project, only need to run
composer install
Possible Solution
See #40774
Additional context
The text was updated successfully, but these errors were encountered: