|
1 <?php |
|
2 |
|
3 /* |
|
4 * This file is part of the Symfony framework. |
|
5 * |
|
6 * (c) Fabien Potencier <fabien@symfony.com> |
|
7 * |
|
8 * This source file is subject to the MIT license that is bundled |
|
9 * with this source code in the file LICENSE. |
|
10 */ |
|
11 |
|
12 namespace Symfony\Component\DependencyInjection\Compiler; |
|
13 |
|
14 use Symfony\Component\DependencyInjection\Definition; |
|
15 |
|
16 /** |
|
17 * Used to format logging messages during the compilation. |
|
18 * |
|
19 * @author Johannes M. Schmitt <schmittjoh@gmail.com> |
|
20 */ |
|
21 class LoggingFormatter |
|
22 { |
|
23 public function formatRemoveService(CompilerPassInterface $pass, $id, $reason) |
|
24 { |
|
25 return $this->format($pass, sprintf('Removed service "%s"; reason: %s', $id, $reason)); |
|
26 } |
|
27 |
|
28 public function formatInlineService(CompilerPassInterface $pass, $id, $target) |
|
29 { |
|
30 return $this->format($pass, sprintf('Inlined service "%s" to "%s".', $id, $target)); |
|
31 } |
|
32 |
|
33 public function formatUpdateReference(CompilerPassInterface $pass, $serviceId, $oldDestId, $newDestId) |
|
34 { |
|
35 return $this->format($pass, sprintf('Changed reference of service "%s" previously pointing to "%s" to "%s".', $serviceId, $oldDestId, $newDestId)); |
|
36 } |
|
37 |
|
38 public function formatResolveInheritance(CompilerPassInterface $pass, $childId, $parentId) |
|
39 { |
|
40 return $this->format($pass, sprintf('Resolving inheritance for "%s" (parent: %s).', $childId, $parentId)); |
|
41 } |
|
42 |
|
43 public function format(CompilerPassInterface $pass, $message) |
|
44 { |
|
45 return sprintf('%s: %s', get_class($pass), $message); |
|
46 } |
|
47 } |