Completed
Push — 2.0 ( 6cd6ae...d9081a )
by Rob
11s
created

AbstractCompilerPass::setDefinitionSharing()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 5
nc 2
nop 2
1
<?php
2
3
/*
4
 * This file is part of the `liip/LiipImagineBundle` project.
5
 *
6
 * (c) https://github.com/liip/LiipImagineBundle/graphs/contributors
7
 *
8
 * For the full copyright and license information, please view the LICENSE.md
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Liip\ImagineBundle\DependencyInjection\Compiler;
13
14
use Liip\ImagineBundle\Utility\Framework\SymfonyFramework;
15
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
16
use Symfony\Component\DependencyInjection\ContainerBuilder;
17
18
abstract class AbstractCompilerPass implements CompilerPassInterface
19
{
20
    /**
21
     * @param ContainerBuilder $container
22
     * @param string           $message
23
     * @param mixed[]          $replacements
24
     */
25
    protected function log(ContainerBuilder $container, $message, array $replacements = [])
26
    {
27
        if (count($replacements) > 0) {
28
            $message = vsprintf($message, $replacements);
29
        }
30
31
        if (SymfonyFramework::hasDirectContainerBuilderLogging()) {
32
            $container->log($this, $message);
33
        } else {
34
            $compiler = $container->getCompiler();
35
            $compiler->addLogMessage($compiler->getLoggingFormatter()->format($this, $message));
0 ignored issues
show
Deprecated Code introduced by
The method Symfony\Component\Depend...::getLoggingFormatter() has been deprecated with message: since version 3.3, to be removed in 4.0. Use the ContainerBuilder::log() method instead.

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
Deprecated Code introduced by
The method Symfony\Component\Depend...mpiler::addLogMessage() has been deprecated with message: since version 3.3, to be removed in 4.0. Use the ContainerBuilder::log() method instead.

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
36
        }
37
    }
38
}
39