/** * Format the link. * * @param Link $link * * @return bool */ public final function format(Link $link) { $formatted = $this->formatting($link); if (empty($formatted)) { // the link has not been formatted by this formatter, try next formatter if (!is_null($this->successor)) { $formatted = $this->successor->format($link); } } return $formatted; }
public function testRootNode() { $snippet = <<<'END' <?php namespace Foo\Baz; class Blorg { public function __construct() {}} END; $expected = <<<'END' <?php namespace Foo\Baz; class Blorg { public function __construct() { } } END; $doc = Parser::parseSource($snippet); $this->formatter->format($doc); $this->assertEquals($expected, $doc->getText()); }
/** * Méthode inutile ? */ private function format(Formatter $formater) { return $formater->format(); }
public function render_formatted_data($data) { $formatter = new Formatter(); echo $formatter->format($data); }
/** * @param $collection * @param null $limit * * @return string */ public function format($collection, $limit = null) { return $this->formatter->format($collection, $limit); }
/** * Returns a formatted string using the specified locale, format string, * and arguments. * * @param l * The {@linkplain java.util.Locale locale} to apply during * formatting. If <tt>l</tt> is <tt>null</tt> then no localization * is applied. * * @param blaze\lang\String|string $format * A <a href="../util/Formatter.html#syntax">format string</a> * * @param array[blaze\lang\Object] args * Arguments referenced by the format specifiers in the format * string. If there are more arguments than format specifiers, the * extra arguments are ignored. The number of arguments is * variable and may be zero. The maximum number of arguments is * limited by the maximum dimension of a Java array as defined by * the <a href="http://java.sun.com/docs/books/vmspec/">Java * Virtual Machine Specification</a>. The behaviour on a * <tt>null</tt> argument depends on the <a * href="../util/Formatter.html#syntax">conversion</a>. * * @throws IllegalFormatException * If a format string contains an illegal syntax, a format * specifier that is incompatible with the given arguments, * insufficient arguments given the format string, or other * illegal conditions. For specification of all possible * formatting errors, see the <a * href="../util/Formatter.html#detail">Details</a> section of the * formatter class specification * * @throws NullPointerException * If the <tt>format</tt> is <tt>null</tt> * * @return blaze\lang\String A formatted string * * @see java.util.Formatter * @since 1.5 */ public static function format($format, $args, Locale $l = null) { $f = new Formatter($l); return $f->format($format, $args)->toString(); }
/** * @param string $output * @return string */ public function underline($output) { return parent::format($output, "", '<u style="text-decoration: underline;">', '</u>'); }
/** * @param string $output * @return string */ public function underline($output) { return parent::format($output, "", "[4m", "[24m"); }