4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\DependencyInjection\Compiler;
14 @trigger_error('The '.__NAMESPACE__.'\LoggingFormatter class is deprecated since Symfony 3.3 and will be removed in 4.0. Use the ContainerBuilder::log() method instead.', E_USER_DEPRECATED);
17 * Used to format logging messages during the compilation.
19 * @author Johannes M. Schmitt <schmittjoh@gmail.com>
21 * @deprecated since version 3.3, to be removed in 4.0. Use the ContainerBuilder::log() method instead.
23 class LoggingFormatter
25 public function formatRemoveService(CompilerPassInterface $pass, $id, $reason)
27 return $this->format($pass, sprintf('Removed service "%s"; reason: %s.', $id, $reason));
30 public function formatInlineService(CompilerPassInterface $pass, $id, $target)
32 return $this->format($pass, sprintf('Inlined service "%s" to "%s".', $id, $target));
35 public function formatUpdateReference(CompilerPassInterface $pass, $serviceId, $oldDestId, $newDestId)
37 return $this->format($pass, sprintf('Changed reference of service "%s" previously pointing to "%s" to "%s".', $serviceId, $oldDestId, $newDestId));
40 public function formatResolveInheritance(CompilerPassInterface $pass, $childId, $parentId)
42 return $this->format($pass, sprintf('Resolving inheritance for "%s" (parent: %s).', $childId, $parentId));
45 public function formatUnusedAutowiringPatterns(CompilerPassInterface $pass, $id, array $patterns)
47 return $this->format($pass, sprintf('Autowiring\'s patterns "%s" for service "%s" don\'t match any method.', implode('", "', $patterns), $id));
50 public function format(CompilerPassInterface $pass, $message)
52 return sprintf('%s: %s', \get_class($pass), $message);