X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2FLicenses.php;h=6467777bff0154253bc410245ba08b738f21336c;hp=0bcbc91b2216eb30bf5da18190d3dc30a6006be0;hb=89539f2aa1b158fdcc703ad053e2580cb97a6385;hpb=484fce617599f79d27b13f7822240ccf9d8721e7 diff --git a/includes/Licenses.php b/includes/Licenses.php index 0bcbc91b22..6467777bff 100644 --- a/includes/Licenses.php +++ b/includes/Licenses.php @@ -32,7 +32,7 @@ class Licenses extends HTMLFormField { protected $msg; /** @var array */ - protected $licenses = array(); + protected $licenses = []; /** @var string */ protected $html; @@ -56,7 +56,7 @@ class Licenses extends HTMLFormField { * @private */ protected function makeLicenses() { - $levels = array(); + $levels = []; $lines = explode( "\n", $this->msg ); foreach ( $lines as $line ) { @@ -88,11 +88,11 @@ class Licenses extends HTMLFormField { */ protected function trimStars( $str ) { $numStars = strspn( $str, '*' ); - return array( $numStars, ltrim( substr( $str, $numStars ), ' ' ) ); + return [ $numStars, ltrim( substr( $str, $numStars ), ' ' ) ]; } /** - * @param array $list + * @param array &$list * @param array $path * @param mixed $item */ @@ -115,17 +115,17 @@ class Licenses extends HTMLFormField { if ( is_array( $val ) ) { $this->html .= $this->outputOption( $key, '', - array( + [ 'disabled' => 'disabled', 'style' => 'color: GrayText', // for MSIE - ), + ], $depth ); $this->makeHtml( $val, $depth + 1 ); } else { $this->html .= $this->outputOption( $val->text, $val->template, - array( 'title' => '{{' . $val->template . '}}' ), + [ 'title' => '{{' . $val->template . '}}' ], $depth ); } @@ -173,13 +173,13 @@ class Licenses extends HTMLFormField { $this->selected = $value; $this->html = $this->outputOption( wfMessage( 'nolicense' )->text(), '', - (bool)$this->selected ? null : array( 'selected' => 'selected' ) ); + (bool)$this->selected ? null : [ 'selected' => 'selected' ] ); $this->makeHtml( $this->getLicenses() ); - $attribs = array( + $attribs = [ 'name' => $this->mName, 'id' => $this->mID - ); + ]; if ( !empty( $this->mParams['disabled'] ) ) { $attibs['disabled'] = 'disabled'; }