Skip to content

[Config] Add support for stringNode in config component  #57660

Closed
@svdv22

Description

@svdv22

Description

Couldn't really find any discussion specifically about stringNode, and I'm wondering if it's worthwhile to create a PR. I notice I'm repeating myself quite a lot:

->scalarNode('my_config_string')
    ->cannotBeEmpty()
    ->validate()
        ->ifTrue(fn($v) => !is_string($v))
        ->thenInvalid('my_config_string must be a string.')
    ->end()
->end()

I've seen the arguments "cluttered API" and "if we want to encourage the usage of bundle configuration validation, we should make it as easy as possible to use" (see #4714). But what's the verdict of a simple stringNode?

Example

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions