Replace array( ... ) by [ ... ] in PHP

Change-Id: Ib41735975aa242709846a5f3acd04e540dd2cfd4
This commit is contained in:
Fomafix 2016-10-14 18:11:52 +02:00
parent c2739d7736
commit 35fce8db4b
8 changed files with 498 additions and 498 deletions

View file

@ -3,7 +3,7 @@
class ApiCategoryTree extends ApiBase { class ApiCategoryTree extends ApiBase {
public function execute() { public function execute() {
$params = $this->extractRequestParams(); $params = $this->extractRequestParams();
$options = array(); $options = [];
if ( isset( $params['options'] ) ) { if ( isset( $params['options'] ) ) {
$options = FormatJson::decode( $params['options'] ); $options = FormatJson::decode( $params['options'] );
if ( !is_object( $options ) ) { if ( !is_object( $options ) ) {
@ -46,10 +46,10 @@ class ApiCategoryTree extends ApiBase {
$params = $this->extractRequestParams(); $params = $this->extractRequestParams();
$title = CategoryTree::makeTitle( $params['category'] ); $title = CategoryTree::makeTitle( $params['category'] );
return wfGetDB( DB_SLAVE )->selectField( 'page', 'page_touched', return wfGetDB( DB_SLAVE )->selectField( 'page', 'page_touched',
array( [
'page_namespace' => NS_CATEGORY, 'page_namespace' => NS_CATEGORY,
'page_title' => $title->getDBkey(), 'page_title' => $title->getDBkey(),
), ],
__METHOD__ __METHOD__
); );
} }
@ -89,10 +89,10 @@ class ApiCategoryTree extends ApiBase {
$wgMemc->set( $wgMemc->set(
$mckey, $mckey,
array( [
'timestamp' => wfTimestampNow(), 'timestamp' => wfTimestampNow(),
'value' => $html 'value' => $html
), ],
86400 86400
); );
} }
@ -100,15 +100,15 @@ class ApiCategoryTree extends ApiBase {
} }
public function getAllowedParams() { public function getAllowedParams() {
return array( return [
'category' => array( 'category' => [
ApiBase::PARAM_TYPE => 'string', ApiBase::PARAM_TYPE => 'string',
ApiBase::PARAM_REQUIRED => true, ApiBase::PARAM_REQUIRED => true,
), ],
'options' => array( 'options' => [
ApiBase::PARAM_TYPE => 'string', ApiBase::PARAM_TYPE => 'string',
), ],
); ];
} }
public function isInternal() { public function isInternal() {

View file

@ -53,7 +53,7 @@ class CategoryTreeCategoryViewer extends CategoryViewer {
} }
function clearCategoryState() { function clearCategoryState() {
$this->child_cats = array(); $this->child_cats = [];
parent::clearCategoryState(); parent::clearCategoryState();
} }

View file

@ -10,494 +10,494 @@
*/ */
// @codingStandardsIgnoreFile // @codingStandardsIgnoreFile
$specialPageAliases = array(); $specialPageAliases = [];
/** English (English) */ /** English (English) */
$specialPageAliases['en'] = array( $specialPageAliases['en'] = [
'CategoryTree' => array( 'CategoryTree' ), 'CategoryTree' => [ 'CategoryTree' ],
); ];
/** Afrikaans (Afrikaans) */ /** Afrikaans (Afrikaans) */
$specialPageAliases['af'] = array( $specialPageAliases['af'] = [
'CategoryTree' => array( 'KategorieBoom' ), 'CategoryTree' => [ 'KategorieBoom' ],
); ];
/** Aragonese (aragonés) */ /** Aragonese (aragonés) */
$specialPageAliases['an'] = array( $specialPageAliases['an'] = [
'CategoryTree' => array( 'Árbol_de_categorías' ), 'CategoryTree' => [ 'Árbol_de_categorías' ],
); ];
/** Arabic (العربية) */ /** Arabic (العربية) */
$specialPageAliases['ar'] = array( $specialPageAliases['ar'] = [
'CategoryTree' => array( 'شجرة_تصنيف' ), 'CategoryTree' => [ 'شجرة_تصنيف' ],
); ];
/** Aramaic (ܐܪܡܝܐ) */ /** Aramaic (ܐܪܡܝܐ) */
$specialPageAliases['arc'] = array( $specialPageAliases['arc'] = [
'CategoryTree' => array( 'ܐܝܠܢܐ_ܕܣܕܪܐ' ), 'CategoryTree' => [ 'ܐܝܠܢܐ_ܕܣܕܪܐ' ],
); ];
/** Egyptian Arabic (مصرى) */ /** Egyptian Arabic (مصرى) */
$specialPageAliases['arz'] = array( $specialPageAliases['arz'] = [
'CategoryTree' => array( 'شجرة_تصنيف' ), 'CategoryTree' => [ 'شجرة_تصنيف' ],
); ];
/** Assamese (অসমীয়া) */ /** Assamese (অসমীয়া) */
$specialPageAliases['as'] = array( $specialPageAliases['as'] = [
'CategoryTree' => array( 'শ্ৰেণীবৃক্ষ' ), 'CategoryTree' => [ 'শ্ৰেণীবৃক্ষ' ],
); ];
/** Avaric (авар) */ /** Avaric (авар) */
$specialPageAliases['av'] = array( $specialPageAliases['av'] = [
'CategoryTree' => array( 'Категориязул_гъветІ' ), 'CategoryTree' => [ 'Категориязул_гъветІ' ],
); ];
/** Bashkir (башҡортса) */ /** Bashkir (башҡортса) */
$specialPageAliases['ba'] = array( $specialPageAliases['ba'] = [
'CategoryTree' => array( 'Категория_ағасы' ), 'CategoryTree' => [ 'Категория_ағасы' ],
); ];
/** Bikol Central (Bikol Central) */ /** Bikol Central (Bikol Central) */
$specialPageAliases['bcl'] = array( $specialPageAliases['bcl'] = [
'CategoryTree' => array( 'KahoyNinKategorya' ), 'CategoryTree' => [ 'KahoyNinKategorya' ],
); ];
/** Belarusian (Taraškievica orthography) (беларуская (тарашкевіца)) */ /** Belarusian (Taraškievica orthography) (беларуская (тарашкевіца)) */
$specialPageAliases['be-tarask'] = array( $specialPageAliases['be-tarask'] = [
'CategoryTree' => array( рэваатэгорыяў' ), 'CategoryTree' => [ рэваатэгорыяў' ],
); ];
/** Bulgarian (български) */ /** Bulgarian (български) */
$specialPageAliases['bg'] = array( $specialPageAliases['bg'] = [
'CategoryTree' => array( 'Дървоаатегориите' ), 'CategoryTree' => [ 'Дървоаатегориите' ],
); ];
/** Western Balochi (بلوچی رخشانی) */ /** Western Balochi (بلوچی رخشانی) */
$specialPageAliases['bgn'] = array( $specialPageAliases['bgn'] = [
'CategoryTree' => array( هری_درچّگ_یا_درخت' ), 'CategoryTree' => [ هری_درچّگ_یا_درخت' ],
); ];
/** Banjar (Bahasa Banjar) */ /** Banjar (Bahasa Banjar) */
$specialPageAliases['bjn'] = array( $specialPageAliases['bjn'] = [
'CategoryTree' => array( 'Puhun_tumbung' ), 'CategoryTree' => [ 'Puhun_tumbung' ],
); ];
/** Breton (brezhoneg) */ /** Breton (brezhoneg) */
$specialPageAliases['br'] = array( $specialPageAliases['br'] = [
'CategoryTree' => array( 'GwezennadurRummad' ), 'CategoryTree' => [ 'GwezennadurRummad' ],
); ];
/** Bosnian (bosanski) */ /** Bosnian (bosanski) */
$specialPageAliases['bs'] = array( $specialPageAliases['bs'] = [
'CategoryTree' => array( 'StabloKategorija' ), 'CategoryTree' => [ 'StabloKategorija' ],
); ];
/** Catalan (català) */ /** Catalan (català) */
$specialPageAliases['ca'] = array( $specialPageAliases['ca'] = [
'CategoryTree' => array( 'Categories_en_arbre', 'Arbre_de_categories' ), 'CategoryTree' => [ 'Categories_en_arbre', 'Arbre_de_categories' ],
); ];
/** Min Dong Chinese (Mìng-dĕ̤ng-ngṳ̄) */ /** Min Dong Chinese (Mìng-dĕ̤ng-ngṳ̄) */
$specialPageAliases['cdo'] = array( $specialPageAliases['cdo'] = [
'CategoryTree' => array( '分類樹' ), 'CategoryTree' => [ '分類樹' ],
); ];
/** Chechen (нохчийн) */ /** Chechen (нохчийн) */
$specialPageAliases['ce'] = array( $specialPageAliases['ce'] = [
'CategoryTree' => array( 'Категорийн_дит' ), 'CategoryTree' => [ 'Категорийн_дит' ],
); ];
/** Czech (čeština) */ /** Czech (čeština) */
$specialPageAliases['cs'] = array( $specialPageAliases['cs'] = [
'CategoryTree' => array( 'Strom_kategorií' ), 'CategoryTree' => [ 'Strom_kategorií' ],
); ];
/** Danish (dansk) */ /** Danish (dansk) */
$specialPageAliases['da'] = array( $specialPageAliases['da'] = [
'CategoryTree' => array( 'Kategoritræ' ), 'CategoryTree' => [ 'Kategoritræ' ],
); ];
/** German (Deutsch) */ /** German (Deutsch) */
$specialPageAliases['de'] = array( $specialPageAliases['de'] = [
'CategoryTree' => array( 'Kategorienbaum', 'Kategoriebaum' ), 'CategoryTree' => [ 'Kategorienbaum', 'Kategoriebaum' ],
); ];
/** Zazaki (Zazaki) */ /** Zazaki (Zazaki) */
$specialPageAliases['diq'] = array( $specialPageAliases['diq'] = [
'CategoryTree' => array( 'DaraKategoriye' ), 'CategoryTree' => [ 'DaraKategoriye' ],
); ];
/** Lower Sorbian (dolnoserbski) */ /** Lower Sorbian (dolnoserbski) */
$specialPageAliases['dsb'] = array( $specialPageAliases['dsb'] = [
'CategoryTree' => array( 'Bom_kategorijow' ), 'CategoryTree' => [ 'Bom_kategorijow' ],
); ];
/** Greek (Ελληνικά) */ /** Greek (Ελληνικά) */
$specialPageAliases['el'] = array( $specialPageAliases['el'] = [
'CategoryTree' => array( 'ΔέντροΚατηγορίας' ), 'CategoryTree' => [ 'ΔέντροΚατηγορίας' ],
); ];
/** Esperanto (Esperanto) */ /** Esperanto (Esperanto) */
$specialPageAliases['eo'] = array( $specialPageAliases['eo'] = [
'CategoryTree' => array( 'Arbo_de_kategorioj', 'Kategorio-arbo' ), 'CategoryTree' => [ 'Arbo_de_kategorioj', 'Kategorio-arbo' ],
); ];
/** Spanish (español) */ /** Spanish (español) */
$specialPageAliases['es'] = array( $specialPageAliases['es'] = [
'CategoryTree' => array( 'ÁrbolDeCategorías', 'Árbol_de_categorías' ), 'CategoryTree' => [ 'ÁrbolDeCategorías', 'Árbol_de_categorías' ],
); ];
/** Estonian (eesti) */ /** Estonian (eesti) */
$specialPageAliases['et'] = array( $specialPageAliases['et'] = [
'CategoryTree' => array( 'Kategooriapuu' ), 'CategoryTree' => [ 'Kategooriapuu' ],
); ];
/** Basque (euskara) */ /** Basque (euskara) */
$specialPageAliases['eu'] = array( $specialPageAliases['eu'] = [
'CategoryTree' => array( 'KategoriaZuhaitza' ), 'CategoryTree' => [ 'KategoriaZuhaitza' ],
); ];
/** Persian (فارسی) */ /** Persian (فارسی) */
$specialPageAliases['fa'] = array( $specialPageAliases['fa'] = [
'CategoryTree' => array( 'درخت_رده' ), 'CategoryTree' => [ 'درخت_رده' ],
); ];
/** Finnish (suomi) */ /** Finnish (suomi) */
$specialPageAliases['fi'] = array( $specialPageAliases['fi'] = [
'CategoryTree' => array( 'Luokkapuu' ), 'CategoryTree' => [ 'Luokkapuu' ],
); ];
/** French (français) */ /** French (français) */
$specialPageAliases['fr'] = array( $specialPageAliases['fr'] = [
'CategoryTree' => array( 'ArbreCatégorie', 'ArbreCategorie', 'Arbre_catégorie' ), 'CategoryTree' => [ 'ArbreCatégorie', 'ArbreCategorie', 'Arbre_catégorie' ],
); ];
/** Arpitan (arpetan) */ /** Arpitan (arpetan) */
$specialPageAliases['frp'] = array( $specialPageAliases['frp'] = [
'CategoryTree' => array( 'Structura_d\'âbro_de_les_catègories', 'StructuraDÂbroDeLesCatègories' ), 'CategoryTree' => [ 'Structura_d\'âbro_de_les_catègories', 'StructuraDÂbroDeLesCatègories' ],
); ];
/** Western Frisian (Frysk) */ /** Western Frisian (Frysk) */
$specialPageAliases['fy'] = array( $specialPageAliases['fy'] = [
'CategoryTree' => array( 'Kategorybeam' ), 'CategoryTree' => [ 'Kategorybeam' ],
); ];
/** Galician (galego) */ /** Galician (galego) */
$specialPageAliases['gl'] = array( $specialPageAliases['gl'] = [
'CategoryTree' => array( 'Árbore_de_categorías' ), 'CategoryTree' => [ 'Árbore_de_categorías' ],
); ];
/** Swiss German (Alemannisch) */ /** Swiss German (Alemannisch) */
$specialPageAliases['gsw'] = array( $specialPageAliases['gsw'] = [
'CategoryTree' => array( 'Kategoriebaum' ), 'CategoryTree' => [ 'Kategoriebaum' ],
); ];
/** Gujarati (ગુજરાતી) */ /** Gujarati (ગુજરાતી) */
$specialPageAliases['gu'] = array( $specialPageAliases['gu'] = [
'CategoryTree' => array( 'શ્રેણીવૃક્ષ' ), 'CategoryTree' => [ 'શ્રેણીવૃક્ષ' ],
); ];
/** Hebrew (עברית) */ /** Hebrew (עברית) */
$specialPageAliases['he'] = array( $specialPageAliases['he'] = [
'CategoryTree' => array( 'עץ_קטגוריות' ), 'CategoryTree' => [ 'עץ_קטגוריות' ],
); ];
/** Hindi (हिन्दी) */ /** Hindi (हिन्दी) */
$specialPageAliases['hi'] = array( $specialPageAliases['hi'] = [
'CategoryTree' => array( 'श्रेणी_वृक्ष', 'श्रेणीवृक्ष' ), 'CategoryTree' => [ 'श्रेणी_वृक्ष', 'श्रेणीवृक्ष' ],
); ];
/** Upper Sorbian (hornjoserbsce) */ /** Upper Sorbian (hornjoserbsce) */
$specialPageAliases['hsb'] = array( $specialPageAliases['hsb'] = [
'CategoryTree' => array( 'Kategorijowy_štom' ), 'CategoryTree' => [ 'Kategorijowy_štom' ],
); ];
/** Xiang Chinese (湘语) */ /** Xiang Chinese (湘语) */
$specialPageAliases['hsn'] = array( $specialPageAliases['hsn'] = [
'CategoryTree' => array( '类别树' ), 'CategoryTree' => [ '类别树' ],
); ];
/** Haitian (Kreyòl ayisyen) */ /** Haitian (Kreyòl ayisyen) */
$specialPageAliases['ht'] = array( $specialPageAliases['ht'] = [
'CategoryTree' => array( 'NivoKategori' ), 'CategoryTree' => [ 'NivoKategori' ],
); ];
/** Hungarian (magyar) */ /** Hungarian (magyar) */
$specialPageAliases['hu'] = array( $specialPageAliases['hu'] = [
'CategoryTree' => array( 'Kategóriafa' ), 'CategoryTree' => [ 'Kategóriafa' ],
); ];
/** Interlingua (interlingua) */ /** Interlingua (interlingua) */
$specialPageAliases['ia'] = array( $specialPageAliases['ia'] = [
'CategoryTree' => array( 'Arbore_de_categorias' ), 'CategoryTree' => [ 'Arbore_de_categorias' ],
); ];
/** Indonesian (Bahasa Indonesia) */ /** Indonesian (Bahasa Indonesia) */
$specialPageAliases['id'] = array( $specialPageAliases['id'] = [
'CategoryTree' => array( 'Pohon_kategori', 'PohonKategori' ), 'CategoryTree' => [ 'Pohon_kategori', 'PohonKategori' ],
); ];
/** Ido (Ido) */ /** Ido (Ido) */
$specialPageAliases['io'] = array( $specialPageAliases['io'] = [
'CategoryTree' => array( 'KategorioArboro' ), 'CategoryTree' => [ 'KategorioArboro' ],
); ];
/** Italian (italiano) */ /** Italian (italiano) */
$specialPageAliases['it'] = array( $specialPageAliases['it'] = [
'CategoryTree' => array( 'AlberoCategorie' ), 'CategoryTree' => [ 'AlberoCategorie' ],
); ];
/** Japanese (日本語) */ /** Japanese (日本語) */
$specialPageAliases['ja'] = array( $specialPageAliases['ja'] = [
'CategoryTree' => array( 'カテゴリツリー' ), 'CategoryTree' => [ 'カテゴリツリー' ],
); ];
/** Georgian (ქართული) */ /** Georgian (ქართული) */
$specialPageAliases['ka'] = array( $specialPageAliases['ka'] = [
'CategoryTree' => array( 'კატეგორიის_ხე' ), 'CategoryTree' => [ 'კატეგორიის_ხე' ],
); ];
/** Khmer (ភាសាខ្មែរ) */ /** Khmer (ភាសាខ្មែរ) */
$specialPageAliases['km'] = array( $specialPageAliases['km'] = [
'CategoryTree' => array( 'មែកធាងចំណាត់ថ្នាក់ក្រុម' ), 'CategoryTree' => [ 'មែកធាងចំណាត់ថ្នាក់ក្រុម' ],
); ];
/** Korean (한국어) */ /** Korean (한국어) */
$specialPageAliases['ko'] = array( $specialPageAliases['ko'] = [
'CategoryTree' => array( '분류트리' ), 'CategoryTree' => [ '분류트리' ],
); ];
/** Colognian (Ripoarisch) */ /** Colognian (Ripoarisch) */
$specialPageAliases['ksh'] = array( $specialPageAliases['ksh'] = [
'CategoryTree' => array( 'Saachjruppeboum' ), 'CategoryTree' => [ 'Saachjruppeboum' ],
); ];
/** Kurdish (Kurdî) */ /** Kurdish (Kurdî) */
$specialPageAliases['ku'] = array( $specialPageAliases['ku'] = [
'CategoryTree' => array( 'Dara_kategoriyan' ), 'CategoryTree' => [ 'Dara_kategoriyan' ],
); ];
/** Cornish (kernowek) */ /** Cornish (kernowek) */
$specialPageAliases['kw'] = array( $specialPageAliases['kw'] = [
'CategoryTree' => array( 'GwedhenGlassys' ), 'CategoryTree' => [ 'GwedhenGlassys' ],
); ];
/** Latin (Latina) */ /** Latin (Latina) */
$specialPageAliases['la'] = array( $specialPageAliases['la'] = [
'CategoryTree' => array( 'Categoriarum_arbor' ), 'CategoryTree' => [ 'Categoriarum_arbor' ],
); ];
/** Ladino (Ladino) */ /** Ladino (Ladino) */
$specialPageAliases['lad'] = array( $specialPageAliases['lad'] = [
'CategoryTree' => array( 'Árvole_de_Kateggorías' ), 'CategoryTree' => [ 'Árvole_de_Kateggorías' ],
); ];
/** Luxembourgish (Lëtzebuergesch) */ /** Luxembourgish (Lëtzebuergesch) */
$specialPageAliases['lb'] = array( $specialPageAliases['lb'] = [
'CategoryTree' => array( 'Struktur_vun_de_Kategorien' ), 'CategoryTree' => [ 'Struktur_vun_de_Kategorien' ],
); ];
/** Northern Luri (لۊری شومالی) */ /** Northern Luri (لۊری شومالی) */
$specialPageAliases['lrc'] = array( $specialPageAliases['lrc'] = [
'CategoryTree' => array( ار_دأسە' ), 'CategoryTree' => [ ار_دأسە' ],
); ];
/** Malagasy (Malagasy) */ /** Malagasy (Malagasy) */
$specialPageAliases['mg'] = array( $specialPageAliases['mg'] = [
'CategoryTree' => array( 'Hazon-tsokajy', 'Hazontsokajy' ), 'CategoryTree' => [ 'Hazon-tsokajy', 'Hazontsokajy' ],
); ];
/** Minangkabau (Baso Minangkabau) */ /** Minangkabau (Baso Minangkabau) */
$specialPageAliases['min'] = array( $specialPageAliases['min'] = [
'CategoryTree' => array( 'BatangKategori' ), 'CategoryTree' => [ 'BatangKategori' ],
); ];
/** Macedonian (македонски) */ /** Macedonian (македонски) */
$specialPageAliases['mk'] = array( $specialPageAliases['mk'] = [
'CategoryTree' => array( 'ДрвоНаКатегории' ), 'CategoryTree' => [ 'ДрвоНаКатегории' ],
); ];
/** Malayalam (മലയാളം) */ /** Malayalam (മലയാളം) */
$specialPageAliases['ml'] = array( $specialPageAliases['ml'] = [
'CategoryTree' => array( 'വർഗ്ഗവൃക്ഷം' ), 'CategoryTree' => [ 'വർഗ്ഗവൃക്ഷം' ],
); ];
/** Marathi (मराठी) */ /** Marathi (मराठी) */
$specialPageAliases['mr'] = array( $specialPageAliases['mr'] = [
'CategoryTree' => array( 'वर्गवृक्ष' ), 'CategoryTree' => [ 'वर्गवृक्ष' ],
); ];
/** Malay (Bahasa Melayu) */ /** Malay (Bahasa Melayu) */
$specialPageAliases['ms'] = array( $specialPageAliases['ms'] = [
'CategoryTree' => array( 'Salasilah_kategori' ), 'CategoryTree' => [ 'Salasilah_kategori' ],
); ];
/** Maltese (Malti) */ /** Maltese (Malti) */
$specialPageAliases['mt'] = array( $specialPageAliases['mt'] = [
'CategoryTree' => array( 'SiġraKategorija' ), 'CategoryTree' => [ 'SiġraKategorija' ],
); ];
/** Erzya (эрзянь) */ /** Erzya (эрзянь) */
$specialPageAliases['myv'] = array( $specialPageAliases['myv'] = [
'CategoryTree' => array( 'КатегорияньЧувто' ), 'CategoryTree' => [ 'КатегорияньЧувто' ],
); ];
/** Norwegian Bokmål (norsk bokmål) */ /** Norwegian Bokmål (norsk bokmål) */
$specialPageAliases['nb'] = array( $specialPageAliases['nb'] = [
'CategoryTree' => array( 'Kategoritre' ), 'CategoryTree' => [ 'Kategoritre' ],
); ];
/** Low German (Plattdüütsch) */ /** Low German (Plattdüütsch) */
$specialPageAliases['nds'] = array( $specialPageAliases['nds'] = [
'CategoryTree' => array( 'Kategorieboom' ), 'CategoryTree' => [ 'Kategorieboom' ],
); ];
/** Low Saxon (Netherlands) (Nedersaksies) */ /** Low Saxon (Netherlands) (Nedersaksies) */
$specialPageAliases['nds-nl'] = array( $specialPageAliases['nds-nl'] = [
'CategoryTree' => array( 'Kategorieboom' ), 'CategoryTree' => [ 'Kategorieboom' ],
); ];
/** Dutch (Nederlands) */ /** Dutch (Nederlands) */
$specialPageAliases['nl'] = array( $specialPageAliases['nl'] = [
'CategoryTree' => array( 'Categorieboom' ), 'CategoryTree' => [ 'Categorieboom' ],
); ];
/** Norwegian Nynorsk (norsk nynorsk) */ /** Norwegian Nynorsk (norsk nynorsk) */
$specialPageAliases['nn'] = array( $specialPageAliases['nn'] = [
'CategoryTree' => array( 'Kategoritre' ), 'CategoryTree' => [ 'Kategoritre' ],
); ];
/** Occitan (occitan) */ /** Occitan (occitan) */
$specialPageAliases['oc'] = array( $specialPageAliases['oc'] = [
'CategoryTree' => array( 'ArbreCategoria', 'Arbre_categoria' ), 'CategoryTree' => [ 'ArbreCategoria', 'Arbre_categoria' ],
); ];
/** Polish (polski) */ /** Polish (polski) */
$specialPageAliases['pl'] = array( $specialPageAliases['pl'] = [
'CategoryTree' => array( 'Drzewo_kategorii' ), 'CategoryTree' => [ 'Drzewo_kategorii' ],
); ];
/** Pashto (پښتو) */ /** Pashto (پښتو) */
$specialPageAliases['ps'] = array( $specialPageAliases['ps'] = [
'CategoryTree' => array( 'د_وېشنيزو_ونه' ), 'CategoryTree' => [ 'د_وېشنيزو_ونه' ],
); ];
/** Portuguese (português) */ /** Portuguese (português) */
$specialPageAliases['pt'] = array( $specialPageAliases['pt'] = [
'CategoryTree' => array( 'Árvore_de_categorias' ), 'CategoryTree' => [ 'Árvore_de_categorias' ],
); ];
/** Brazilian Portuguese (português do Brasil) */ /** Brazilian Portuguese (português do Brasil) */
$specialPageAliases['pt-br'] = array( $specialPageAliases['pt-br'] = [
'CategoryTree' => array( 'Árvore_de_categorias', 'Árvore_de_categoria' ), 'CategoryTree' => [ 'Árvore_de_categorias', 'Árvore_de_categoria' ],
); ];
/** Romanian (română) */ /** Romanian (română) */
$specialPageAliases['ro'] = array( $specialPageAliases['ro'] = [
'CategoryTree' => array( 'Arborele_categoriilor' ), 'CategoryTree' => [ 'Arborele_categoriilor' ],
); ];
/** Russian (русский) */ /** Russian (русский) */
$specialPageAliases['ru'] = array( $specialPageAliases['ru'] = [
'CategoryTree' => array( еревоатегорий' ), 'CategoryTree' => [ еревоатегорий' ],
); ];
/** Sanskrit (संस्कृतम्) */ /** Sanskrit (संस्कृतम्) */
$specialPageAliases['sa'] = array( $specialPageAliases['sa'] = [
'CategoryTree' => array( 'वर्गवृक्ष:' ), 'CategoryTree' => [ 'वर्गवृक्ष:' ],
); ];
/** Sicilian (sicilianu) */ /** Sicilian (sicilianu) */
$specialPageAliases['scn'] = array( $specialPageAliases['scn'] = [
'CategoryTree' => array( 'AlberoCategorie' ), 'CategoryTree' => [ 'AlberoCategorie' ],
); ];
/** Sinhala (සිංහල) */ /** Sinhala (සිංහල) */
$specialPageAliases['si'] = array( $specialPageAliases['si'] = [
'CategoryTree' => array( 'ප්‍රවර්ගරුක' ), 'CategoryTree' => [ 'ප්‍රවර්ගරුක' ],
); ];
/** Slovak (slovenčina) */ /** Slovak (slovenčina) */
$specialPageAliases['sk'] = array( $specialPageAliases['sk'] = [
'CategoryTree' => array( 'StromKategórií' ), 'CategoryTree' => [ 'StromKategórií' ],
); ];
/** Swedish (svenska) */ /** Swedish (svenska) */
$specialPageAliases['sv'] = array( $specialPageAliases['sv'] = [
'CategoryTree' => array( 'Kategoriträd' ), 'CategoryTree' => [ 'Kategoriträd' ],
); ];
/** Swahili (Kiswahili) */ /** Swahili (Kiswahili) */
$specialPageAliases['sw'] = array( $specialPageAliases['sw'] = [
'CategoryTree' => array( 'SafuyaJamii' ), 'CategoryTree' => [ 'SafuyaJamii' ],
); ];
/** Telugu (తెలుగు) */ /** Telugu (తెలుగు) */
$specialPageAliases['te'] = array( $specialPageAliases['te'] = [
'CategoryTree' => array( 'వర్గవృక్షం' ), 'CategoryTree' => [ 'వర్గవృక్షం' ],
); ];
/** Thai (ไทย) */ /** Thai (ไทย) */
$specialPageAliases['th'] = array( $specialPageAliases['th'] = [
'CategoryTree' => array( 'หมวดหมู่แบบผังต้นไม้' ), 'CategoryTree' => [ 'หมวดหมู่แบบผังต้นไม้' ],
); ];
/** Tagalog (Tagalog) */ /** Tagalog (Tagalog) */
$specialPageAliases['tl'] = array( $specialPageAliases['tl'] = [
'CategoryTree' => array( 'Puno_ng_kaurian' ), 'CategoryTree' => [ 'Puno_ng_kaurian' ],
); ];
/** Talysh (толышә зывон) */ /** Talysh (толышә зывон) */
$specialPageAliases['tly'] = array( $specialPageAliases['tly'] = [
'CategoryTree' => array( 'Категоријон_до' ), 'CategoryTree' => [ 'Категоријон_до' ],
); ];
/** Turkish (Türkçe) */ /** Turkish (Türkçe) */
$specialPageAliases['tr'] = array( $specialPageAliases['tr'] = [
'CategoryTree' => array( 'KategoriAğacı', 'KategoriHiyerarşisi', 'UlamAğacı', 'UlamHiyerarşisi' ), 'CategoryTree' => [ 'KategoriAğacı', 'KategoriHiyerarşisi', 'UlamAğacı', 'UlamHiyerarşisi' ],
); ];
/** Ukrainian (українська) */ /** Ukrainian (українська) */
$specialPageAliases['uk'] = array( $specialPageAliases['uk'] = [
'CategoryTree' => array( еревоатегорій' ), 'CategoryTree' => [ еревоатегорій' ],
); ];
/** Urdu (اردو) */ /** Urdu (اردو) */
$specialPageAliases['ur'] = array( $specialPageAliases['ur'] = [
'CategoryTree' => array( 'شجرہ_زمرہ' ), 'CategoryTree' => [ 'شجرہ_زمرہ' ],
); ];
/** Venetian (vèneto) */ /** Venetian (vèneto) */
$specialPageAliases['vec'] = array( $specialPageAliases['vec'] = [
'CategoryTree' => array( 'ÀlbaroCategorie' ), 'CategoryTree' => [ 'ÀlbaroCategorie' ],
); ];
/** Veps (vepsän kel) */ /** Veps (vepsän kel) */
$specialPageAliases['vep'] = array( $specialPageAliases['vep'] = [
'CategoryTree' => array( 'KategorijoidenPu' ), 'CategoryTree' => [ 'KategorijoidenPu' ],
); ];
/** Vietnamese (Tiếng Việt) */ /** Vietnamese (Tiếng Việt) */
$specialPageAliases['vi'] = array( $specialPageAliases['vi'] = [
'CategoryTree' => array( 'Cây_thể_loại' ), 'CategoryTree' => [ 'Cây_thể_loại' ],
); ];
/** Yiddish (ייִדיש) */ /** Yiddish (ייִדיש) */
$specialPageAliases['yi'] = array( $specialPageAliases['yi'] = [
'CategoryTree' => array( 'קאטעגאריע_בוים' ), 'CategoryTree' => [ 'קאטעגאריע_בוים' ],
); ];
/** Simplified Chinese (中文(简体)‎) */ /** Simplified Chinese (中文(简体)‎) */
$specialPageAliases['zh-hans'] = array( $specialPageAliases['zh-hans'] = [
'CategoryTree' => array( '分类树' ), 'CategoryTree' => [ '分类树' ],
); ];
/** Traditional Chinese (中文(繁體)‎) */ /** Traditional Chinese (中文(繁體)‎) */
$specialPageAliases['zh-hant'] = array( $specialPageAliases['zh-hant'] = [
'CategoryTree' => array( '分類樹' ), 'CategoryTree' => [ '分類樹' ],
); ];
/** Chinese (Taiwan) (中文(台灣)‎) */ /** Chinese (Taiwan) (中文(台灣)‎) */
$specialPageAliases['zh-tw'] = array( $specialPageAliases['zh-tw'] = [
'CategoryTree' => array( '分類樹' ), 'CategoryTree' => [ '分類樹' ],
); ];

View file

@ -90,7 +90,7 @@ class CategoryTreeHooks {
$cat = array_shift( $params ); $cat = array_shift( $params );
// build associative arguments from flat parameter list // build associative arguments from flat parameter list
$argv = array(); $argv = [];
foreach ( $params as $p ) { foreach ( $params as $p ) {
if ( preg_match( '/^\s*(\S.*?)\s*=\s*(.*?)\s*$/', $p, $m ) ) { if ( preg_match( '/^\s*(\S.*?)\s*=\s*(.*?)\s*$/', $p, $m ) ) {
$k = $m[1]; $k = $m[1];
@ -105,7 +105,7 @@ class CategoryTreeHooks {
// now handle just like a <categorytree> tag // now handle just like a <categorytree> tag
$html = self::parserHook( $cat, $argv, $parser ); $html = self::parserHook( $cat, $argv, $parser );
return array( $html, 'noparse' => true, 'isHTML' => true ); return [ $html, 'noparse' => true, 'isHTML' => true ];
} }
/** /**

View file

@ -9,249 +9,249 @@
* @license GNU General Public Licence 2.0 or later * @license GNU General Public Licence 2.0 or later
*/ */
$magicWords = array(); $magicWords = [];
/** English (English) */ /** English (English) */
$magicWords['en'] = array( $magicWords['en'] = [
'categorytree' => array( 0, 'categorytree' ), 'categorytree' => [ 0, 'categorytree' ],
); ];
/** Afrikaans (Afrikaans) */ /** Afrikaans (Afrikaans) */
$magicWords['af'] = array( $magicWords['af'] = [
'categorytree' => array( 0, 'kategorieboom', 'categorytree' ), 'categorytree' => [ 0, 'kategorieboom', 'categorytree' ],
); ];
/** Arabic (العربية) */ /** Arabic (العربية) */
$magicWords['ar'] = array( $magicWords['ar'] = [
'categorytree' => array( 0, 'شجرة_تصنيف' ), 'categorytree' => [ 0, 'شجرة_تصنيف' ],
); ];
/** Egyptian Arabic (مصرى) */ /** Egyptian Arabic (مصرى) */
$magicWords['arz'] = array( $magicWords['arz'] = [
'categorytree' => array( 0, 'شجرة_تصنيف' ), 'categorytree' => [ 0, 'شجرة_تصنيف' ],
); ];
/** Breton (brezhoneg) */ /** Breton (brezhoneg) */
$magicWords['br'] = array( $magicWords['br'] = [
'categorytree' => array( 0, 'GwezennadurRummad' ), 'categorytree' => [ 0, 'GwezennadurRummad' ],
); ];
/** Chechen (нохчийн) */ /** Chechen (нохчийн) */
$magicWords['ce'] = array( $magicWords['ce'] = [
'categorytree' => array( 0, 'категоридит', 'деревокатегорий' ), 'categorytree' => [ 0, 'категоридит', 'деревокатегорий' ],
); ];
/** German (Deutsch) */ /** German (Deutsch) */
$magicWords['de'] = array( $magicWords['de'] = [
'categorytree' => array( 0, 'kategorienbaum', 'kategoriebaum' ), 'categorytree' => [ 0, 'kategorienbaum', 'kategoriebaum' ],
); ];
/** Zazaki (Zazaki) */ /** Zazaki (Zazaki) */
$magicWords['diq'] = array( $magicWords['diq'] = [
'categorytree' => array( 0, 'darakategori' ), 'categorytree' => [ 0, 'darakategori' ],
); ];
/** Esperanto (Esperanto) */ /** Esperanto (Esperanto) */
$magicWords['eo'] = array( $magicWords['eo'] = [
'categorytree' => array( 0, 'kategoriarbo' ), 'categorytree' => [ 0, 'kategoriarbo' ],
); ];
/** Spanish (español) */ /** Spanish (español) */
$magicWords['es'] = array( $magicWords['es'] = [
'categorytree' => array( 0, 'árboldecategorías', 'arboldecategorias' ), 'categorytree' => [ 0, 'árboldecategorías', 'arboldecategorias' ],
); ];
/** Estonian (eesti) */ /** Estonian (eesti) */
$magicWords['et'] = array( $magicWords['et'] = [
'categorytree' => array( 0, 'kategooriapuu' ), 'categorytree' => [ 0, 'kategooriapuu' ],
); ];
/** Persian (فارسی) */ /** Persian (فارسی) */
$magicWords['fa'] = array( $magicWords['fa'] = [
'categorytree' => array( 0, 'درخت‌رده', 'درخت_رده' ), 'categorytree' => [ 0, 'درخت‌رده', 'درخت_رده' ],
); ];
/** French (français) */ /** French (français) */
$magicWords['fr'] = array( $magicWords['fr'] = [
'categorytree' => array( 0, 'arbrecatégories', 'arbrecats' ), 'categorytree' => [ 0, 'arbrecatégories', 'arbrecats' ],
); ];
/** Western Frisian (Frysk) */ /** Western Frisian (Frysk) */
$magicWords['fy'] = array( $magicWords['fy'] = [
'categorytree' => array( 0, 'kategorybeam' ), 'categorytree' => [ 0, 'kategorybeam' ],
); ];
/** Galician (galego) */ /** Galician (galego) */
$magicWords['gl'] = array( $magicWords['gl'] = [
'categorytree' => array( 0, 'árboredecategorías' ), 'categorytree' => [ 0, 'árboredecategorías' ],
); ];
/** Hebrew (עברית) */ /** Hebrew (עברית) */
$magicWords['he'] = array( $magicWords['he'] = [
'categorytree' => array( 0, 'עץ_קטגוריה' ), 'categorytree' => [ 0, 'עץ_קטגוריה' ],
); ];
/** Hindi (हिन्दी) */ /** Hindi (हिन्दी) */
$magicWords['hi'] = array( $magicWords['hi'] = [
'categorytree' => array( 0, 'श्रेणी_वृक्ष' ), 'categorytree' => [ 0, 'श्रेणी_वृक्ष' ],
); ];
/** Igbo (Igbo) */ /** Igbo (Igbo) */
$magicWords['ig'] = array( $magicWords['ig'] = [
'categorytree' => array( 0, 'óshíshíébéonọr', 'categorytree' ), 'categorytree' => [ 0, 'óshíshíébéonọr', 'categorytree' ],
); ];
/** Italian (italiano) */ /** Italian (italiano) */
$magicWords['it'] = array( $magicWords['it'] = [
'categorytree' => array( 0, 'alberocategorie' ), 'categorytree' => [ 0, 'alberocategorie' ],
); ];
/** Japanese (日本語) */ /** Japanese (日本語) */
$magicWords['ja'] = array( $magicWords['ja'] = [
'categorytree' => array( 0, 'カテゴリツリー' ), 'categorytree' => [ 0, 'カテゴリツリー' ],
); ];
/** Georgian (ქართული) */ /** Georgian (ქართული) */
$magicWords['ka'] = array( $magicWords['ka'] = [
'categorytree' => array( 0, 'კატეგორიის_ხე' ), 'categorytree' => [ 0, 'კატეგორიის_ხე' ],
); ];
/** Korean (한국어) */ /** Korean (한국어) */
$magicWords['ko'] = array( $magicWords['ko'] = [
'categorytree' => array( 0, '분류트리' ), 'categorytree' => [ 0, '분류트리' ],
); ];
/** Kurdish (Latin script) (Kurdî (latînî)) */ /** Kurdish (Latin script) (Kurdî (latînî)) */
$magicWords['ku-latn'] = array( $magicWords['ku-latn'] = [
'categorytree' => array( 0, 'dara_kategoriyan' ), 'categorytree' => [ 0, 'dara_kategoriyan' ],
); ];
/** Cornish (kernowek) */ /** Cornish (kernowek) */
$magicWords['kw'] = array( $magicWords['kw'] = [
'categorytree' => array( 0, 'gwedhenglass' ), 'categorytree' => [ 0, 'gwedhenglass' ],
); ];
/** Ladino (Ladino) */ /** Ladino (Ladino) */
$magicWords['lad'] = array( $magicWords['lad'] = [
'categorytree' => array( 0, 'árvoledekateggorías', 'árboldecategorías', 'arboldecategorias', 'categorytree' ), 'categorytree' => [ 0, 'árvoledekateggorías', 'árboldecategorías', 'arboldecategorias', 'categorytree' ],
); ];
/** Malagasy (Malagasy) */ /** Malagasy (Malagasy) */
$magicWords['mg'] = array( $magicWords['mg'] = [
'categorytree' => array( 0, 'karazantsokajy', 'categorytree' ), 'categorytree' => [ 0, 'karazantsokajy', 'categorytree' ],
); ];
/** Macedonian (македонски) */ /** Macedonian (македонски) */
$magicWords['mk'] = array( $magicWords['mk'] = [
'categorytree' => array( 0, 'стеблонакатегории' ), 'categorytree' => [ 0, 'стеблонакатегории' ],
); ];
/** Malayalam (മലയാളം) */ /** Malayalam (മലയാളം) */
$magicWords['ml'] = array( $magicWords['ml'] = [
'categorytree' => array( 0, 'വർഗ്ഗവൃക്ഷം' ), 'categorytree' => [ 0, 'വർഗ്ഗവൃക്ഷം' ],
); ];
/** Marathi (मराठी) */ /** Marathi (मराठी) */
$magicWords['mr'] = array( $magicWords['mr'] = [
'categorytree' => array( 0, 'वर्गवृक्ष' ), 'categorytree' => [ 0, 'वर्गवृक्ष' ],
); ];
/** Norwegian Bokmål (norsk bokmål) */ /** Norwegian Bokmål (norsk bokmål) */
$magicWords['nb'] = array( $magicWords['nb'] = [
'categorytree' => array( 0, 'kategoritre' ), 'categorytree' => [ 0, 'kategoritre' ],
); ];
/** Low Saxon (Netherlands) (Nedersaksies) */ /** Low Saxon (Netherlands) (Nedersaksies) */
$magicWords['nds-nl'] = array( $magicWords['nds-nl'] = [
'categorytree' => array( 0, 'kategorieboom', 'categorieboom' ), 'categorytree' => [ 0, 'kategorieboom', 'categorieboom' ],
); ];
/** Dutch (Nederlands) */ /** Dutch (Nederlands) */
$magicWords['nl'] = array( $magicWords['nl'] = [
'categorytree' => array( 0, 'categorieboom' ), 'categorytree' => [ 0, 'categorieboom' ],
); ];
/** Norwegian Nynorsk (norsk nynorsk) */ /** Norwegian Nynorsk (norsk nynorsk) */
$magicWords['nn'] = array( $magicWords['nn'] = [
'categorytree' => array( 0, 'kategoritre' ), 'categorytree' => [ 0, 'kategoritre' ],
); ];
/** Polish (polski) */ /** Polish (polski) */
$magicWords['pl'] = array( $magicWords['pl'] = [
'categorytree' => array( 0, 'drzewokategorii' ), 'categorytree' => [ 0, 'drzewokategorii' ],
); ];
/** Romanian (română) */ /** Romanian (română) */
$magicWords['ro'] = array( $magicWords['ro'] = [
'categorytree' => array( 0, 'arborecategorie' ), 'categorytree' => [ 0, 'arborecategorie' ],
); ];
/** Russian (русский) */ /** Russian (русский) */
$magicWords['ru'] = array( $magicWords['ru'] = [
'categorytree' => array( 0, 'деревокатегорий' ), 'categorytree' => [ 0, 'деревокатегорий' ],
); ];
/** Serbian (Cyrillic script) (српски (ћирилица)) */ /** Serbian (Cyrillic script) (српски (ћирилица)) */
$magicWords['sr-ec'] = array( $magicWords['sr-ec'] = [
'categorytree' => array( 0, 'стаблокатегорије', 'стаблоатегорије' ), 'categorytree' => [ 0, 'стаблокатегорије', 'стаблоатегорије' ],
); ];
/** Serbian (Latin script) (srpski (latinica)) */ /** Serbian (Latin script) (srpski (latinica)) */
$magicWords['sr-el'] = array( $magicWords['sr-el'] = [
'categorytree' => array( 0, 'stablokategorije', 'stablo_kategorije' ), 'categorytree' => [ 0, 'stablokategorije', 'stablo_kategorije' ],
); ];
/** Swedish (svenska) */ /** Swedish (svenska) */
$magicWords['sv'] = array( $magicWords['sv'] = [
'categorytree' => array( 0, 'kategoriträd', 'categorytree' ), 'categorytree' => [ 0, 'kategoriträd', 'categorytree' ],
); ];
/** Turkish (Türkçe) */ /** Turkish (Türkçe) */
$magicWords['tr'] = array( $magicWords['tr'] = [
'categorytree' => array( 0, 'kategorihiyerarşisi', 'kategoriağacı', 'ulamhiyerarşisi', 'ulamağacı' ), 'categorytree' => [ 0, 'kategorihiyerarşisi', 'kategoriağacı', 'ulamhiyerarşisi', 'ulamağacı' ],
); ];
/** Tatar (Cyrillic script) (татарча) */ /** Tatar (Cyrillic script) (татарча) */
$magicWords['tt-cyrl'] = array( $magicWords['tt-cyrl'] = [
'categorytree' => array( 0, 'төркемнәр_шәҗәрәсе' ), 'categorytree' => [ 0, 'төркемнәр_шәҗәрәсе' ],
); ];
/** Tuvinian (тыва дыл) */ /** Tuvinian (тыва дыл) */
$magicWords['tyv'] = array( $magicWords['tyv'] = [
'categorytree' => array( 0, 'аңгылал_ыяжы' ), 'categorytree' => [ 0, 'аңгылал_ыяжы' ],
); ];
/** Ukrainian (українська) */ /** Ukrainian (українська) */
$magicWords['uk'] = array( $magicWords['uk'] = [
'categorytree' => array( 0, 'деревокатегорій' ), 'categorytree' => [ 0, 'деревокатегорій' ],
); ];
/** Urdu (اردو) */ /** Urdu (اردو) */
$magicWords['ur'] = array( $magicWords['ur'] = [
'categorytree' => array( 0, 'شجر_زمرہ' ), 'categorytree' => [ 0, 'شجر_زمرہ' ],
); ];
/** Uzbek (oʻzbekcha/ўзбекча) */ /** Uzbek (oʻzbekcha/ўзбекча) */
$magicWords['uz'] = array( $magicWords['uz'] = [
'categorytree' => array( 0, 'turkumiyerarxiyasi', 'turkumdaraxti' ), 'categorytree' => [ 0, 'turkumiyerarxiyasi', 'turkumdaraxti' ],
); ];
/** Vietnamese (Tiếng Việt) */ /** Vietnamese (Tiếng Việt) */
$magicWords['vi'] = array( $magicWords['vi'] = [
'categorytree' => array( 0, 'cây_thể_loại', 'câythểloại' ), 'categorytree' => [ 0, 'cây_thể_loại', 'câythểloại' ],
); ];
/** Yiddish (ייִדיש) */ /** Yiddish (ייִדיש) */
$magicWords['yi'] = array( $magicWords['yi'] = [
'categorytree' => array( 0, 'קאטעגאריע_בוים' ), 'categorytree' => [ 0, 'קאטעגאריע_בוים' ],
); ];
/** Simplified Chinese (中文(简体)‎) */ /** Simplified Chinese (中文(简体)‎) */
$magicWords['zh-hans'] = array( $magicWords['zh-hans'] = [
'categorytree' => array( 0, '分类树' ), 'categorytree' => [ 0, '分类树' ],
); ];
/** Traditional Chinese (中文(繁體)‎) */ /** Traditional Chinese (中文(繁體)‎) */
$magicWords['zh-hant'] = array( $magicWords['zh-hant'] = [
'categorytree' => array( 0, '分類樹' ), 'categorytree' => [ 0, '分類樹' ],
); ];

View file

@ -10,10 +10,10 @@
* *
* This shim maintains compatibility back to MediaWiki 1.17. * This shim maintains compatibility back to MediaWiki 1.17.
*/ */
$messages = array(); $messages = [];
if ( !function_exists( 'wfJsonI18nShimed9738563f370e2c' ) ) { if ( !function_exists( 'wfJsonI18nShimed9738563f370e2c' ) ) {
function wfJsonI18nShimed9738563f370e2c( $cache, $code, &$cachedData ) { function wfJsonI18nShimed9738563f370e2c( $cache, $code, &$cachedData ) {
$codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); $codeSequence = array_merge( [ $code ], $cachedData['fallbackSequence'] );
foreach ( $codeSequence as $csCode ) { foreach ( $codeSequence as $csCode ) {
$fileName = dirname( __FILE__ ) . "/i18n/$csCode.json"; $fileName = dirname( __FILE__ ) . "/i18n/$csCode.json";
if ( is_readable( $fileName ) ) { if ( is_readable( $fileName ) ) {

View file

@ -11,7 +11,7 @@
*/ */
class CategoryTree { class CategoryTree {
public $mOptions = array(); public $mOptions = [];
/** /**
* @param $options array * @param $options array
@ -81,7 +81,7 @@ class CategoryTree {
$nn = preg_split( '![\s#:|]+!', $nn ); $nn = preg_split( '![\s#:|]+!', $nn );
} }
$namespaces = array(); $namespaces = [];
foreach ( $nn as $n ) { foreach ( $nn as $n ) {
if ( is_int( $n ) ) { if ( is_int( $n ) ) {
@ -334,7 +334,7 @@ class CategoryTree {
$html .= Html::openElement( 'div', $attr ); $html .= Html::openElement( 'div', $attr );
if ( !$allowMissing && !$title->getArticleID() ) { if ( !$allowMissing && !$title->getArticleID() ) {
$html .= Html::openElement( 'span', array( 'class' => 'CategoryTreeNotice' ) ); $html .= Html::openElement( 'span', [ 'class' => 'CategoryTreeNotice' ] );
if ( $parser ) { if ( $parser ) {
$html .= $parser->recursiveTagParse( wfMessage( 'categorytree-not-found', $category )->plain() ); $html .= $parser->recursiveTagParse( wfMessage( 'categorytree-not-found', $category )->plain() );
} else { } else {
@ -376,19 +376,19 @@ class CategoryTree {
$mode = $this->getOption( 'mode' ); $mode = $this->getOption( 'mode' );
$namespaces = $this->getOption( 'namespaces' ); $namespaces = $this->getOption( 'namespaces' );
$tables = array( 'page', 'categorylinks' ); $tables = [ 'page', 'categorylinks' ];
$fields = array( 'page_id', 'page_namespace', 'page_title', $fields = [ 'page_id', 'page_namespace', 'page_title',
'page_is_redirect', 'page_len', 'page_latest', 'cl_to', 'page_is_redirect', 'page_len', 'page_latest', 'cl_to',
'cl_from' ); 'cl_from' ];
$where = array(); $where = [];
$joins = array(); $joins = [];
$options = array( 'ORDER BY' => 'cl_type, cl_sortkey', 'LIMIT' => $wgCategoryTreeMaxChildren ); $options = [ 'ORDER BY' => 'cl_type, cl_sortkey', 'LIMIT' => $wgCategoryTreeMaxChildren ];
if ( $inverse ) { if ( $inverse ) {
$joins['categorylinks'] = array( 'RIGHT JOIN', array( 'cl_to = page_title', 'page_namespace' => NS_CATEGORY ) ); $joins['categorylinks'] = [ 'RIGHT JOIN', [ 'cl_to = page_title', 'page_namespace' => NS_CATEGORY ] ];
$where['cl_from'] = $title->getArticleID(); $where['cl_from'] = $title->getArticleID();
} else { } else {
$joins['categorylinks'] = array( 'JOIN', 'cl_from = page_id' ); $joins['categorylinks'] = [ 'JOIN', 'cl_from = page_id' ];
$where['cl_to'] = $title->getDBkey(); $where['cl_to'] = $title->getDBkey();
$options['USE INDEX']['categorylinks'] = 'cl_sortkey'; $options['USE INDEX']['categorylinks'] = 'cl_sortkey';
@ -398,7 +398,7 @@ class CategoryTree {
$where['page_namespace'] = $namespaces; $where['page_namespace'] = $namespaces;
} elseif ( $mode != CategoryTreeMode::ALL ) { } elseif ( $mode != CategoryTreeMode::ALL ) {
if ( $mode == CategoryTreeMode::PAGES ) { if ( $mode == CategoryTreeMode::PAGES ) {
$where['cl_type'] = array( 'page', 'subcat' ); $where['cl_type'] = [ 'page', 'subcat' ];
} else { } else {
$where['cl_type'] = 'subcat'; $where['cl_type'] = 'subcat';
} }
@ -409,9 +409,9 @@ class CategoryTree {
$doCount = !$inverse && $wgCategoryTreeUseCategoryTable; $doCount = !$inverse && $wgCategoryTreeUseCategoryTable;
if ( $doCount ) { if ( $doCount ) {
$tables = array_merge( $tables, array( 'category' ) ); $tables = array_merge( $tables, [ 'category' ] );
$fields = array_merge( $fields, array( 'cat_id', 'cat_title', 'cat_subcats', 'cat_pages', 'cat_files' ) ); $fields = array_merge( $fields, [ 'cat_id', 'cat_title', 'cat_subcats', 'cat_pages', 'cat_files' ] );
$joins['category'] = array( 'LEFT JOIN', array( 'cat_title = page_title', 'page_namespace' => NS_CATEGORY ) ); $joins['category'] = [ 'LEFT JOIN', [ 'cat_title = page_title', 'page_namespace' => NS_CATEGORY ] ];
} }
$res = $dbr->select( $tables, $fields, $where, __METHOD__, $options, $joins ); $res = $dbr->select( $tables, $fields, $where, __METHOD__, $options, $joins );
@ -461,16 +461,16 @@ class CategoryTree {
$res = $dbr->select( $res = $dbr->select(
'categorylinks', 'categorylinks',
array( [
'page_namespace' => NS_CATEGORY, 'page_namespace' => NS_CATEGORY,
'page_title' => 'cl_to', 'page_title' => 'cl_to',
), ],
array( 'cl_from' => $title->getArticleID() ), [ 'cl_from' => $title->getArticleID() ],
__METHOD__, __METHOD__,
array( [
'LIMIT' => $wgCategoryTreeMaxChildren, 'LIMIT' => $wgCategoryTreeMaxChildren,
'ORDER BY' => 'cl_to' 'ORDER BY' => 'cl_to'
) ]
); );
$special = SpecialPage::getTitleFor( 'CategoryTree' ); $special = SpecialPage::getTitleFor( 'CategoryTree' );
@ -489,8 +489,8 @@ class CategoryTree {
$s .= wfMessage( 'pipe-separator' )->escaped(); $s .= wfMessage( 'pipe-separator' )->escaped();
} }
$s .= Xml::openElement( 'span', array( 'class' => 'CategoryTreeItem' ) ); $s .= Xml::openElement( 'span', [ 'class' => 'CategoryTreeItem' ] );
$s .= Xml::openElement( 'a', array( 'class' => 'CategoryTreeLabel', 'href' => $wikiLink ) ) $s .= Xml::openElement( 'a', [ 'class' => 'CategoryTreeLabel', 'href' => $wikiLink ] )
. $label . Xml::closeElement( 'a' ); . $label . Xml::closeElement( 'a' );
$s .= Xml::closeElement( 'span' ); $s .= Xml::closeElement( 'span' );
@ -578,10 +578,10 @@ class CategoryTree {
# Specifically, the CategoryTreeChildren div must be the first # Specifically, the CategoryTreeChildren div must be the first
# sibling with nodeName = DIV of the grandparent of the expland link. # sibling with nodeName = DIV of the grandparent of the expland link.
$s .= Xml::openElement( 'div', array( 'class' => 'CategoryTreeSection' ) ); $s .= Xml::openElement( 'div', [ 'class' => 'CategoryTreeSection' ] );
$s .= Xml::openElement( 'div', array( 'class' => 'CategoryTreeItem' ) ); $s .= Xml::openElement( 'div', [ 'class' => 'CategoryTreeItem' ] );
$attr = array( 'class' => 'CategoryTreeBullet' ); $attr = [ 'class' => 'CategoryTreeBullet' ];
# Get counts, with conversion to integer so === works # Get counts, with conversion to integer so === works
# Note: $allCount is the total number of cat members, # Note: $allCount is the total number of cat members,
@ -605,7 +605,7 @@ class CategoryTree {
$bullet = wfMessage( 'categorytree-empty-bullet' )->plain() . ' '; $bullet = wfMessage( 'categorytree-empty-bullet' )->plain() . ' ';
$attr['class'] = 'CategoryTreeEmptyBullet'; $attr['class'] = 'CategoryTreeEmptyBullet';
} else { } else {
$linkattr = array( ); $linkattr = [];
$linkattr[ 'class' ] = "CategoryTreeToggle"; $linkattr[ 'class' ] = "CategoryTreeToggle";
$linkattr['style'] = 'display: none;'; // Unhidden by JS $linkattr['style'] = 'display: none;'; // Unhidden by JS
@ -630,23 +630,23 @@ class CategoryTree {
} }
$s .= Xml::tags( 'span', $attr, $bullet ) . ' '; $s .= Xml::tags( 'span', $attr, $bullet ) . ' ';
$s .= Xml::openElement( 'a', array( 'class' => $labelClass, 'href' => $wikiLink ) ) $s .= Xml::openElement( 'a', [ 'class' => $labelClass, 'href' => $wikiLink ] )
. $label . Xml::closeElement( 'a' ); . $label . Xml::closeElement( 'a' );
if ( $count !== false && $this->getOption( 'showcount' ) ) { if ( $count !== false && $this->getOption( 'showcount' ) ) {
$pages = $allCount - $subcatCount - $fileCount; $pages = $allCount - $subcatCount - $fileCount;
global $wgContLang, $wgLang; global $wgContLang, $wgLang;
$attr = array( $attr = [
'title' => wfMessage( 'categorytree-member-counts' ) 'title' => wfMessage( 'categorytree-member-counts' )
->numParams( $subcatCount, $pages , $fileCount, $allCount, $count )->text(), ->numParams( $subcatCount, $pages , $fileCount, $allCount, $count )->text(),
'dir' => $wgLang->getDir() # numbers and commas get messed up in a mixed dir env 'dir' => $wgLang->getDir() # numbers and commas get messed up in a mixed dir env
); ];
$s .= $wgContLang->getDirMark() . ' '; $s .= $wgContLang->getDirMark() . ' ';
# Create a list of category members with only non-zero member counts # Create a list of category members with only non-zero member counts
$memberNums = array(); $memberNums = [];
if ( $subcatCount ) { if ( $subcatCount ) {
$memberNums[] = wfMessage( 'categorytree-num-categories' ) $memberNums[] = wfMessage( 'categorytree-num-categories' )
->numParams( $subcatCount )->text(); ->numParams( $subcatCount )->text();
@ -678,16 +678,16 @@ class CategoryTree {
$s .= "\n\t\t"; $s .= "\n\t\t";
$s .= Xml::openElement( $s .= Xml::openElement(
'div', 'div',
array( [
'class' => 'CategoryTreeChildren', 'class' => 'CategoryTreeChildren',
'style' => $children > 0 ? "display:block" : "display:none" 'style' => $children > 0 ? "display:block" : "display:none"
) ]
); );
if ( $ns == NS_CATEGORY && $children > 0 ) { if ( $ns == NS_CATEGORY && $children > 0 ) {
$children = $this->renderChildren( $title, $children ); $children = $this->renderChildren( $title, $children );
if ( $children == '' ) { if ( $children == '' ) {
$s .= Xml::openElement( 'i', array( 'class' => 'CategoryTreeNotice' ) ); $s .= Xml::openElement( 'i', [ 'class' => 'CategoryTreeNotice' ] );
if ( $mode == CategoryTreeMode::CATEGORIES ) { if ( $mode == CategoryTreeMode::CATEGORIES ) {
$s .= wfMessage( 'categorytree-no-subcategories' )->text(); $s .= wfMessage( 'categorytree-no-subcategories' )->text();
} elseif ( $mode == CategoryTreeMode::PAGES ) { } elseif ( $mode == CategoryTreeMode::PAGES ) {

View file

@ -58,7 +58,7 @@ class CategoryTreePage extends SpecialPage {
$this->target = null; $this->target = null;
} }
$options = array(); $options = [];
# grab all known options from the request. Normalization is done by the CategoryTree class # grab all known options from the request. Normalization is done by the CategoryTree class
foreach ( $wgCategoryTreeDefaultOptions as $option => $default ) { foreach ( $wgCategoryTreeDefaultOptions as $option => $default ) {
@ -84,7 +84,7 @@ class CategoryTreePage extends SpecialPage {
$title = CategoryTree::makeTitle( $this->target ); $title = CategoryTree::makeTitle( $this->target );
if ( $title && $title->getArticleID() ) { if ( $title && $title->getArticleID() ) {
$output->addHTML( Xml::openElement( 'div', array( 'class' => 'CategoryTreeParents' ) ) ); $output->addHTML( Xml::openElement( 'div', [ 'class' => 'CategoryTreeParents' ] ) );
$output->addHTML( $this->msg( 'categorytree-parents' )->parse() ); $output->addHTML( $this->msg( 'categorytree-parents' )->parse() );
$output->addHTML( $this->msg( 'colon-separator' )->escaped() ); $output->addHTML( $this->msg( 'colon-separator' )->escaped() );
@ -98,11 +98,11 @@ class CategoryTreePage extends SpecialPage {
$output->addHTML( Xml::closeElement( 'div' ) ); $output->addHTML( Xml::closeElement( 'div' ) );
$output->addHTML( Xml::openElement( 'div', array( 'class' => 'CategoryTreeResult' ) ) ); $output->addHTML( Xml::openElement( 'div', [ 'class' => 'CategoryTreeResult' ] ) );
$output->addHTML( $this->tree->renderNode( $title, 1 ) ); $output->addHTML( $this->tree->renderNode( $title, 1 ) );
$output->addHTML( Xml::closeElement( 'div' ) ); $output->addHTML( Xml::closeElement( 'div' ) );
} else { } else {
$output->addHTML( Xml::openElement( 'div', array( 'class' => 'CategoryTreeNotice' ) ) ); $output->addHTML( Xml::openElement( 'div', [ 'class' => 'CategoryTreeNotice' ] ) );
$output->addHTML( $this->msg( 'categorytree-not-found', $this->target )->parse() ); $output->addHTML( $this->msg( 'categorytree-not-found', $this->target )->parse() );
$output->addHTML( Xml::closeElement( 'div' ) ); $output->addHTML( Xml::closeElement( 'div' ) );
} }
@ -178,11 +178,11 @@ class CategoryTreePage extends SpecialPage {
} }
if ( !$title ) { if ( !$title ) {
// No prefix suggestion outside of category namespace // No prefix suggestion outside of category namespace
return array(); return [];
} }
// Autocomplete subpage the same as a normal search, but just for categories // Autocomplete subpage the same as a normal search, but just for categories
$prefixSearcher = new TitlePrefixSearch; $prefixSearcher = new TitlePrefixSearch;
$result = $prefixSearcher->search( $title->getPrefixedText(), $limit, array( NS_CATEGORY ), $offset ); $result = $prefixSearcher->search( $title->getPrefixedText(), $limit, [ NS_CATEGORY ], $offset );
return array_map( function ( Title $t ) { return array_map( function ( Title $t ) {
// Remove namespace in search suggestion // Remove namespace in search suggestion