Skip to content

[RFC][VarDumper] Add ability to style integer and double values separately #39393

@1ma

Description

@1ma

The CliDumper is not currently able to style integer and double values separately. This is a bit unfortunate since in PHP they are fundamentally different types, and in some contexts such as REPLs this coloring can be a bit confusing.

I'd like to add the ability to style both types separately via CliDumper::setStyles(), but maintaining the current default behavior and avoiding BC breaks.

Proposed Patch

The problem with simply replacing $style = 'num' in each branch is that then setting a custom num style via setStyles() would no longer work. But CliDumper could keep using num unless the user of the library sets integer or double through setStyles(), which currently no one does. I believe this would deliver the feature without any client breakage. If it looks good to you I can submit the PR myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFCRFC = Request For Comments (proposals about features that you want to be discussed)VarDumper

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions