Skip to content

[HttpKernel] Update AbstractBundle.php, use !isset($this->path) #52298

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
Oct 25, 2023

Conversation

tacman
Copy link
Contributor

@tacman tacman commented Oct 25, 2023

Fixes issue #52292

Q A
Branch? 7.0
Bug fix? yes
New feature? no
Deprecations?no
Issues Fix #52292
License MIT

Check for isset rather than accessing the property before initialization.

!! Error {https://github.com/symfony/symfony/pull/111
!! #message: "Typed property Symfony\Component\HttpKernel\Bundle\Bundle::$path must not be accessed before initialization"
!! #code: 0
!! #file: "./vendor/symfony/http-kernel/Bundle/AbstractBundle.php"
!! #line: 53
!! trace: {

@carsonbot carsonbot added this to the 7.0 milestone Oct 25, 2023
@carsonbot carsonbot changed the title Update AbstractBundle.php, use !isset($this->path) [HttpKernel] Update AbstractBundle.php, use !isset($this->path) Oct 25, 2023
@nicolas-grekas
Copy link
Member

Thank you @tacman.

@nicolas-grekas nicolas-grekas merged commit 4406087 into symfony:7.0 Oct 25, 2023
@tacman tacman deleted the patch-5 branch October 25, 2023 21:42
@xabbuh
Copy link
Member

xabbuh commented Oct 26, 2023

Shouldn't we initialize the protected properties in Bundle with null instead as those added types would also break third-party code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants