Completed
Push — 1.0 ( 7c0f50...b3be8f )
by Rob
8s
created

AbstractCompilerPass::log()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 14
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 9
nc 4
nop 3
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 Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
17
abstract class AbstractCompilerPass implements CompilerPassInterface
18
{
19
    /**
20
     * {@inheritdoc}
21
     */
22
    protected function log(ContainerBuilder $container, $message, array $replacements = array())
23
    {
24
        if (count($replacements) > 0) {
25
            $message = vsprintf($message, $replacements);
26
        }
27
28
        if (method_exists($container, 'log')) {
29
            $container->log($this, $message);
30
        } else {
31
            $compiler = $container->getCompiler();
32
            $formatter = $compiler->getLoggingFormatter();
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...
33
            $compiler->addLogMessage($formatter->format($this, $message));
0 ignored issues
show
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...
34
        }
35
    }
36
}
37