*/
class InstallDocFormatter {
- static function format( $text ) {
+ /** @var string */
+ private $text;
+
+ public static function format( $text ) {
$obj = new self( $text );
return $obj->execute();
protected function execute() {
$text = $this->text;
// Use Unix line endings, escape some wikitext stuff
- $text = str_replace( array( '<', '{{', '[[', '__', "\r" ),
- array( '<', '{{', '[[', '__', '' ), $text );
+ $text = str_replace( [ '<', '{{', '[[', '__', "\r" ],
+ [ '<', '{{', '[[', '__', '' ], $text );
// join word-wrapped lines into one
do {
$prev = $text;