src/Configuration/Compiler/PhpParserCompilerPass.php
public function markServiceAsPrototype(Definition $definition)
    {
        if (method_exists($definition, 'setShared')) {
            $definition->setShared(false);

            return;
        }

        if (method_exists($definition, 'setScope')) {
            $definition->setScope('prototype');

            return;
        }

        throw new RuntimeException('The visitor could not be marked as unshared');
    }
public function markServiceAsPrototype(Definition $definition)
    {
        if (method_exists($definition, 'setShared')) {
            $definition->setShared(false);

            return;
        }

        if (method_exists($definition, 'setScope')) {
            $definition->setScope('prototype');

            return;
        }

        throw new RuntimeException('The visitor could not be marked as unshared');
    }
public function markServiceAsPrototype ( Definition $ definition ) { if ( method_exists ( $ definition , 'setShared' ) ) { $ definition -> setShared ( false ) ; return ; } if ( method_exists ( $ definition , 'setScope' ) ) { $ definition -> setScope ( 'prototype' ) ; return ; } throw new RuntimeException ( 'The visitor could not be marked as unshared' ) ; }
This method can be used to make the service shared cross-version.
From Symfony 2.8 the setShared method was available.
The 2.7 version is the LTS, so we still need to support it.

@see http://symfony.com/blog/new-in-symfony-3-1-customizable-yaml-parsing-and-dumping

@throws \GrumPHP\Exception\RuntimeException
This method can be used to make the service shared cross - version . From Symfony 2 . 8 the setShared method was available . The 2 . 7 version is the LTS so we still need to support it .