Chris@0: Chris@0: * Chris@0: * For the full copyright and license information, please view the LICENSE Chris@0: * file that was distributed with this source code. Chris@0: */ Chris@0: Chris@0: namespace Symfony\Component\DependencyInjection\Compiler; Chris@0: Chris@0: /** Chris@0: * Used to format logging messages during the compilation. Chris@0: * Chris@0: * @author Johannes M. Schmitt Chris@0: */ Chris@0: class LoggingFormatter Chris@0: { Chris@0: public function formatRemoveService(CompilerPassInterface $pass, $id, $reason) Chris@0: { Chris@0: return $this->format($pass, sprintf('Removed service "%s"; reason: %s.', $id, $reason)); Chris@0: } Chris@0: Chris@0: public function formatInlineService(CompilerPassInterface $pass, $id, $target) Chris@0: { Chris@0: return $this->format($pass, sprintf('Inlined service "%s" to "%s".', $id, $target)); Chris@0: } Chris@0: Chris@0: public function formatUpdateReference(CompilerPassInterface $pass, $serviceId, $oldDestId, $newDestId) Chris@0: { Chris@0: return $this->format($pass, sprintf('Changed reference of service "%s" previously pointing to "%s" to "%s".', $serviceId, $oldDestId, $newDestId)); Chris@0: } Chris@0: Chris@0: public function formatResolveInheritance(CompilerPassInterface $pass, $childId, $parentId) Chris@0: { Chris@0: return $this->format($pass, sprintf('Resolving inheritance for "%s" (parent: %s).', $childId, $parentId)); Chris@0: } Chris@0: Chris@0: public function format(CompilerPassInterface $pass, $message) Chris@0: { Chris@0: return sprintf('%s: %s', get_class($pass), $message); Chris@0: } Chris@0: }