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\Console\Formatter;
15 * Formatter interface for console output.
17 * @author Konstantin Kudryashov <ever.zet@gmail.com>
19 interface OutputFormatterInterface
22 * Sets the decorated flag.
24 * @param bool $decorated Whether to decorate the messages or not
26 public function setDecorated($decorated);
29 * Gets the decorated flag.
31 * @return bool true if the output will decorate messages, false otherwise
33 public function isDecorated();
38 * @param string $name The style name
39 * @param OutputFormatterStyleInterface $style The style instance
41 public function setStyle($name, OutputFormatterStyleInterface $style);
44 * Checks if output formatter has style with specified name.
50 public function hasStyle($name);
53 * Gets style options from style with specified name.
57 * @return OutputFormatterStyleInterface
59 * @throws \InvalidArgumentException When style isn't defined
61 public function getStyle($name);
64 * Formats a message according to the given styles.
66 * @param string $message The message to style
68 * @return string The styled message
70 public function format($message);