<p dir="auto">I get an error if i try to install symfony2.7 via composer</p>
<p dir="auto">trigger_error('Symfony\Component\DependencyInjection\Definition::setFactoryMethod(getRepository) is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead.', 16384) /Symfony/Component/DependencyInjection/Definition.php:137</p>
<p dir="auto">It seems that the XMLFileLoader on 2.7 is not updated. In the master, the problem seem to be solved.</p>
<p dir="auto"><a href="https://github.com/symfony/DependencyInjection/blob/2.7/Loader/XmlFileLoader.php#L150">https://github.com/symfony/DependencyInjection/blob/2.7/Loader/XmlFileLoader.php#L150</a></p>
<p dir="auto">Starting on a PR regarding another issue and I hooked up on of my applications to 2.8 instead of 2.6. For me this was 2 seconds to figure out it was caused by the old way of defining a factory service + method, but the error message might cause a lot of confusion for others. The message is thrown in the Definition class rather than the place where you expect it (Yaml Loader in this case).</p>
<p dir="auto">The fix for this is to change your service definition:</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    # old
    app.layout.menu.beta:
        class: Knp\Menu\MenuItem
        factory_service: app.layout.menu_builder
        factory_method: createBetaMenu
        tags:
            - { name: knp_menu.menu, alias: beta }

    # new
    app.layout.menu.beta:
        class: Knp\Menu\MenuItem
        factory: [@app.layout.menu_builder, createBetaMenu]
        tags:
            - { name: knp_menu.menu, alias: beta }"><pre class="notranslate">    <span class="pl-c"><span class="pl-c">#</span> old</span>
    <span class="pl-ent">app.layout.menu.beta</span>:
        <span class="pl-ent">class</span>: <span class="pl-s">Knp\Menu\MenuItem</span>
        <span class="pl-ent">factory_service</span>: <span class="pl-s">app.layout.menu_builder</span>
        <span class="pl-ent">factory_method</span>: <span class="pl-s">createBetaMenu</span>
        <span class="pl-ent">tags</span>:
            - <span class="pl-s">{ name: knp_menu.menu, alias: beta }</span>

    <span class="pl-c"><span class="pl-c">#</span> new</span>
    <span class="pl-ent">app.layout.menu.beta</span>:
        <span class="pl-ent">class</span>: <span class="pl-s">Knp\Menu\MenuItem</span>
        <span class="pl-ent">factory</span>: <span class="pl-s">[@app.layout.menu_builder, createBetaMenu]</span>
        <span class="pl-ent">tags</span>:
            - <span class="pl-s">{ name: knp_menu.menu, alias: beta }</span></pre></div>
<p dir="auto">The thing is that the error message below does not clearly reflect that. I don't think it's desired to put this information in the message below, but maybe someone has a nice idea where to put it instead.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Deprecated: The Symfony\Component\DependencyInjection\Definition::setFactoryMethod method is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead. in /home/ivanderberg/projects/symfony/src/Symfony/Component/DependencyInjection/Definition.php on line 137"><pre class="notranslate"><code class="notranslate">Deprecated: The Symfony\Component\DependencyInjection\Definition::setFactoryMethod method is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead. in /home/ivanderberg/projects/symfony/src/Symfony/Component/DependencyInjection/Definition.php on line 137
</code></pre></div>