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

AbstractCompilerPass   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 20
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A log() 0 14 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