Skip to content

[VarDumper] Fixes Typed property Symfony\Component\VarDumper\Dumper\CliDumper::$colors must not be accessed before initialization #53521

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
Jan 12, 2024

Conversation

crynobone
Copy link
Contributor

@crynobone crynobone commented Jan 12, 2024

Q A
Branch? 7.0
Bug fix? yes
New feature? no
Deprecations? no
Issues N/A
License MIT

Fixes the following error:

CleanShot 2024-01-12 at 16 27 25

Other methods in the class start with $this->colors ??= $this->supportsColors();. I believe this should have the same code.

@carsonbot carsonbot added this to the 7.0 milestone Jan 12, 2024
@crynobone crynobone changed the title [VarDumper] Fixes ` Typed property Symfony\Component\VarDumper\Dumper\CliDumper::… [VarDumper] Fixes Typed property Symfony\Component\VarDumper\Dumper\CliDumper::$colors must not be accessed before initialization Jan 12, 2024
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

if we're missing an initialization here, it means the patch should likely go on 5.4

@crynobone
Copy link
Contributor Author

if we're missing an initialization here, it means the patch should likely go on 5.4

Not exactly, since 7.0 changed from protected $colors; to protected bool $colors;.

…CliDumper::$colors must not be accessed before initialization`
@fabpot
Copy link
Member

fabpot commented Jan 12, 2024

Thank you @crynobone.

@fabpot fabpot merged commit 63d9a53 into symfony:7.0 Jan 12, 2024
@crynobone crynobone deleted the patch-1 branch January 14, 2024 23:36
xabbuh added a commit that referenced this pull request Jan 16, 2024
…r` (nicolas-grekas)

This PR was merged into the 5.4 branch.

Discussion
----------

 [VarDumper] Fix missing colors initialization in `CliDumper`

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | -
| License       | MIT

Backporting #53521 to 5.4

Commits
-------

6817109 [VarDumper] Fix missing colors initialization in CliDumper
@fabpot fabpot mentioned this pull request Jan 31, 2024
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.

5 participants