Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Config] ignoreExtraKeys(false) is misleading  #33590

Closed
@tomasfejfar

Description

@tomasfejfar

Symfony version(s) affected: all

Description

In my company there is perpentual problem with the understanding of ignoreExtraKeys(false). And yes, when you see it in code you automatically assume that it disables ignoring the extra keys. Yet it does not. The "false" refers to the fact that it does not remove those extra keys.

Possible Solution

Either deprecate the call and add unambiguous methods (e.g. setIgnoreExtraKeys(bool $shouldKeysBeIgnored): void and setRemoveExtraKeys(bool $shouldExtraKeysBeRemoved): void) or at least add a constant to use in place of true/false (EXTRA_KEYS_KEEP=true and EXTRA_KEYS_REMOVE=false).

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