Skip to content

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

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy