<p dir="auto">DoctrineAbstractBundle contains only the base DI extension used by all Doctrine_Bundles. It was a good idea when we had all bundles in the core but it seems wrong now that they are in different repos, updated at different time. A change in it is likely to break another Doctrine_Bundle as the testsuite does not check this for us to make us update them. So these bundles may easily become broken because of an internal change in DoctrineBundle (like what occurred in <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/symfony/symfony/commit/3ca1ccbf6764de5e2d48b2ddabdd2f1eb7075459/hovercard" href="https://github.com/symfony/symfony/commit/3ca1ccbf6764de5e2d48b2ddabdd2f1eb7075459"><tt>3ca1ccb</tt></a> for instance).<br>
The bad thing about it would be some code duplication between the different bundles. <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/fabpot/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/fabpot">@fabpot</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/jwage/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/jwage">@jwage</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/beberlei/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/beberlei">@beberlei</a> <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/lsmith/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/lsmith">@lsmith</a> what do you think about it ?</p>
<p dir="auto">Btw, the DoctrineBundle DI extension should probably be refactored to use abstract service definitions instead of defining full services in PHP in the extension. It would make it smaller (but this feature was introduced in the DI component after writing DoctrineBundle). I will add it on my todo-list so it is the right time to choose whether we keep the DoctrineAbstractBundle or no (one refactoring is better than two).</p>
<p dir="auto">I think we should change <code class="notranslate">YamlExtension::dump</code> method to return <code class="notranslate">$this-&gt;encode($value);</code> in the end because it does not output boolean values as string. If a parameter attribute in the request contains the value <code class="notranslate">false</code> or <code class="notranslate">true</code> (for example <code class="notranslate">_template_streamable</code>) in the Profiler application, the result will be an empty string. Of course, we expect to have the string <code class="notranslate">false</code> or <code class="notranslate">true</code> displayed according to the value in the <code class="notranslate">_template_streamable</code> attribute (or whatever request boolean attribute).</p>
<p dir="auto">If we force a string value containing special characters to be encoded in Yaml, the output in the Profiler will be appended and prepended with single quotes like this:</p>
<p dir="auto">Before:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Acme\DemoBundle\Controller\DemoController::helloAction"><pre class="notranslate"><code class="notranslate">Acme\DemoBundle\Controller\DemoController::helloAction
</code></pre></div>
<p dir="auto">After:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="'Acme\DemoBundle\Controller\DemoController::helloAction'"><pre class="notranslate"><code class="notranslate">'Acme\DemoBundle\Controller\DemoController::helloAction'
</code></pre></div>
<p dir="auto">Maybe we can also leave the return statement as is and add this at the beginning of the method:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if (is_bool($value)) {
    return (true === $value) ? 'true' : 'false';
}"><pre class="notranslate"><code class="notranslate">if (is_bool($value)) {
    return (true === $value) ? 'true' : 'false';
}
</code></pre></div>
<p dir="auto">But it's a duplication of code of what we have in the <code class="notranslate">Symfony\Component\Yaml\Inline::dump</code> method.</p>
<p dir="auto">So my two questions are:</p>
<ul dir="auto">
<li>Should we return <code class="notranslate">$this-&gt;encode($value)</code> at the end of the <code class="notranslate">YamlExtension::dump</code> method or should we simply add a test on boolean values at the top of this method to return the strings <code class="notranslate">false</code> or <code class="notranslate">true</code>?</li>
<li>On which branch should we apply the patch?</li>
</ul>
<p dir="auto">Thanks.</p>