Skip to content

[Config] Use plural name on array values #40878

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 21, 2021

Conversation

Nyholm
Copy link
Member

@Nyholm Nyholm commented Apr 19, 2021

Q A
Branch? 5.x
Bug fix? yes
New feature? no
Deprecations? no
Tickets
License MIT
Doc PR Related: symfony/symfony-docs#15264

If we have a PrototypedArrayNode and the prototype is does not have a key (->useAttributeAsKey('name')). Then we know for sure that the value should be an array.

See this example from $framework->assets()

    /**
+    * @param list<mixed>
     * @return $this
     */
-   public function baseUrl($value): self 
+   public function baseUrls(array $value): self
    {
        $this->baseUrls = $value;
    
        return $this;
    }

@Nyholm Nyholm added this to the 5.3 milestone Apr 20, 2021
@Nyholm Nyholm force-pushed the config-plural-name branch from b3c3915 to 851f55f Compare April 21, 2021 07:38
@Nyholm
Copy link
Member Author

Nyholm commented Apr 21, 2021

This is a small BC break in the generated code added in 5.3-beta1

@nicolas-grekas
Copy link
Member

Thank you @Nyholm.

@nicolas-grekas nicolas-grekas merged commit f82c118 into symfony:5.x Apr 21, 2021
@Nyholm
Copy link
Member Author

Nyholm commented Apr 21, 2021

Thank you for the reviews and the merge!

@Nyholm Nyholm deleted the config-plural-name branch April 21, 2021 09:23
@fabpot fabpot mentioned this pull request May 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants