$out .= Html::openElement( 'ul' );
$error = strtok( $errors, "\n" );
- $badLines = array();
+ $badLines = [];
while ( $error !== false ) {
if ( preg_match( '/^line (\d+)/', $error, $m ) ) {
$lineNum = intval( $m[1] );
$badLines[$lineNum] = true;
$out .= Html::rawElement( 'li', null,
- Html::element( 'a', array( 'href' => "#line-{$lineNum}" ), $error ) ) . "\n";
+ Html::element( 'a', [ 'href' => "#line-{$lineNum}" ], $error ) ) . "\n";
}
$error = strtok( "\n" );
}
$line = strtok( $s, "\n" );
$i = 1;
while ( $line !== false ) {
- $attrs = array();
+ $attrs = [];
if ( isset( $badLines[$i] ) ) {
$attrs['class'] = 'highlight';
$attrs['id'] = "line-$i";
li { white-space: pre }
CSS;
- $out = Html::htmlHeader( array( 'lang' => 'en', 'dir' => 'ltr' ) ) .
+ $out = Html::htmlHeader( [ 'lang' => 'en', 'dir' => 'ltr' ] ) .
Html::rawElement( 'head', null,
Html::element( 'title', null, 'HTML validation error' ) .
Html::inlineStyle( $style ) ) .