eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\Suggestion\Formatter\YamlSuggestionFormatter::format PHP Метод

format() публичный Метод

public format ( ConfigSuggestion $configSuggestion )
$configSuggestion eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\Suggestion\ConfigSuggestion
    public function format(ConfigSuggestion $configSuggestion)
    {
        $message = $configSuggestion->getMessage();
        $suggestion = $configSuggestion->getSuggestion();
        if ($suggestion) {
            $yamlConfig = Yaml::dump($suggestion, 8);
            if (php_sapi_name() !== 'cli') {
                $yamlConfig = "<pre>{$yamlConfig}</pre>";
            }
            return <<<EOT
{$message}


Example:
========

{$yamlConfig}
EOT;
        }
        return $message;
    }

Usage Example

 public function testFormatNoSuggestion()
 {
     $message = 'This is a message';
     $suggestion = new ConfigSuggestion($message);
     $formatter = new YamlSuggestionFormatter();
     $this->assertSame($message, $formatter->format($suggestion));
 }
All Usage Examples Of eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Configuration\Suggestion\Formatter\YamlSuggestionFormatter::format
YamlSuggestionFormatter