<p dir="auto"><code class="notranslate">OptionsResolve::resolve</code> method produces <code class="notranslate">Options::all</code> call before validating option values. <code class="notranslate">Options::all</code> call then executes normalizers with options that have not been validated yet. This makes it impossible to constrain options that are passed to normalizers in form types, like <code class="notranslate">ChoiceType</code>, <code class="notranslate">CollectionType</code>, <code class="notranslate">CountryType</code>, <code class="notranslate">LanguageType</code>, <code class="notranslate">LocaleType</code>, <code class="notranslate">TimezoneType</code>, <code class="notranslate">TimeType</code> and <code class="notranslate">CurrencyType</code>.</p>
<p dir="auto">This issue was discovered while fixing <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="40500906" data-permission-text="Title is private" data-url="https://github.com/symfony/symfony/issues/11694" data-hovercard-type="issue" data-hovercard-url="/symfony/symfony/issues/11694/hovercard" href="https://github.com/symfony/symfony/issues/11694">#11694</a> with PR <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="40506718" data-permission-text="Title is private" data-url="https://github.com/symfony/symfony/issues/11696" data-hovercard-type="pull_request" data-hovercard-url="/symfony/symfony/pull/11696/hovercard" href="https://github.com/symfony/symfony/pull/11696">#11696</a></p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;?php
/** @Route */
class Controller
{
    /** @Route */ 
    method action()
}"><pre class="notranslate"><span class="pl-ent">&lt;?php</span>
<span class="pl-c">/** @Route */</span>
<span class="pl-k">class</span> <span class="pl-v">Controller</span>
{
    <span class="pl-c">/** @Route */</span> 
    method action()
}</pre></div>
<p dir="auto">The annotation class loader does a bad job at merging class level settings with method level settings.</p>
<p dir="auto">IE if the methods are [get, post] at class level and [post] at method level, the resulting methods will be [post, post].</p>
<p dir="auto">This could easily be fixed but how:</p>
<ul dir="auto">
<li>Should the class level params take precedence,</li>
<li>Should the method level params take precedence,</li>
<li>Should we do what other loader do for when merging collections - which has my pref.</li>
</ul>
<p dir="auto">If we pick the last choice, we might want to delegate the params merging to an exterbal service so that all loaders use the same services and code duplication stop causing troubles.</p>
<p dir="auto">One last thing is where this should be merge ? This is obviously a bug fix but it also breaks BC and so I would recommend not to merge this to 2.0 and 2.1 but add this issue to a list of known issues for those realeses and fix from 2.2 onwards.</p>