Skip to content

Conversation

acoulton
Copy link
Contributor

The ->withOutputVerbosity formatter config method in PHP is expected to take an OutputVerbosity::VERBOSITY_* constant value (as per the phpdoc for that method).

If the user's YAML config contains one of the valid values as an integer we can convert it to a constant reference. This will make the PHP file clearer without e.g. needing a separate comment as might have been present in the YAML.

If we don't recognise the value (it may be invalid, or e.g. an env var) then we just convert it as the original scalar value.

The `->withOutputVerbosity` formatter config method in PHP is expected
to take an `OutputVerbosity::VERBOSITY_*` constant value (as per the
phpdoc for that method).

If the user's YAML config contains one of the valid values as an integer
we can convert it to a constant reference. This will make the PHP file
clearer without e.g. needing a separate comment as might have been
present in the YAML.

If we don't recognise the value (it may be invalid, or e.g. an env var)
then we just convert it as the original scalar value.
Copy link
Contributor

@carlos-granados carlos-granados left a comment

Choose a reason for hiding this comment

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

Great addition @acoulton

@acoulton acoulton merged commit 6f8c88d into Behat:master Apr 15, 2025
18 checks passed
@acoulton acoulton deleted the feat-convert-formatter-verbosity branch April 15, 2025 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants