Skip to content

Commit f8037be

Browse files
committed
fixed CS
1 parent b14226d commit f8037be

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

Data/Generator/LanguageDataGenerator.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class LanguageDataGenerator extends AbstractDataGenerator
2929
/**
3030
* Source: http://www-01.sil.org/iso639-3/codes.asp.
3131
*/
32-
private static $preferredAlpha2ToAlpha3Mapping = array(
32+
private static $preferredAlpha2ToAlpha3Mapping = [
3333
'ak' => 'aka',
3434
'ar' => 'ara',
3535
'ay' => 'aym',
@@ -81,20 +81,20 @@ class LanguageDataGenerator extends AbstractDataGenerator
8181
'yi' => 'yid',
8282
'za' => 'zha',
8383
'zh' => 'zho',
84-
);
85-
private static $blacklist = array(
84+
];
85+
private static $blacklist = [
8686
'mul' => true, // Multiple languages
8787
'mis' => true, // Uncoded language
8888
'und' => true, // Unknown language
8989
'zxx' => true, // No linguistic content
90-
);
90+
];
9191

9292
/**
9393
* Collects all available language codes.
9494
*
9595
* @var string[]
9696
*/
97-
private $languageCodes = array();
97+
private $languageCodes = [];
9898

9999
/**
100100
* {@inheritdoc}
@@ -118,7 +118,7 @@ protected function compileTemporaryBundles(GenrbCompiler $compiler, $sourceDir,
118118
*/
119119
protected function preGenerate()
120120
{
121-
$this->languageCodes = array();
121+
$this->languageCodes = [];
122122
}
123123

124124
/**
@@ -130,10 +130,10 @@ protected function generateDataForLocale(BundleReaderInterface $reader, $tempDir
130130

131131
// isset() on \ResourceBundle returns true even if the value is null
132132
if (isset($localeBundle['Languages']) && null !== $localeBundle['Languages']) {
133-
$data = array(
133+
$data = [
134134
'Version' => $localeBundle['Version'],
135135
'Names' => self::generateLanguageNames($localeBundle),
136-
);
136+
];
137137

138138
$this->languageCodes = array_merge($this->languageCodes, array_keys($data['Names']));
139139

@@ -160,12 +160,12 @@ protected function generateDataForMeta(BundleReaderInterface $reader, $tempDir)
160160

161161
sort($this->languageCodes);
162162

163-
return array(
163+
return [
164164
'Version' => $rootBundle['Version'],
165165
'Languages' => $this->languageCodes,
166166
'Aliases' => array_column(iterator_to_array($metadataBundle['alias']['language']), 'replacement'),
167167
'Alpha2ToAlpha3' => $this->generateAlpha2ToAlpha3Mapping($metadataBundle),
168-
);
168+
];
169169
}
170170

171171
private static function generateLanguageNames(ArrayAccessibleResourceBundle $localeBundle): array
@@ -176,7 +176,7 @@ private static function generateLanguageNames(ArrayAccessibleResourceBundle $loc
176176
private function generateAlpha2ToAlpha3Mapping(ArrayAccessibleResourceBundle $metadataBundle)
177177
{
178178
$aliases = iterator_to_array($metadataBundle['alias']['language']);
179-
$alpha2ToAlpha3 = array();
179+
$alpha2ToAlpha3 = [];
180180

181181
foreach ($aliases as $alias => $language) {
182182
$language = $language['replacement'];

Data/Util/LocaleScanner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function scanAliases($sourceDir)
8989
public function scanParents(string $sourceDir): array
9090
{
9191
$locales = $this->scanLocales($sourceDir);
92-
$fallbacks = array();
92+
$fallbacks = [];
9393

9494
foreach ($locales as $locale) {
9595
$content = \file_get_contents($sourceDir.'/'.$locale.'.txt');

Tests/Data/Util/LocaleScannerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,21 +69,21 @@ protected function tearDown()
6969

7070
public function testScanLocales()
7171
{
72-
$sortedLocales = array('de', 'de_alias', 'de_child', 'en', 'en_alias', 'en_child', 'fr', 'fr_alias', 'fr_child');
72+
$sortedLocales = ['de', 'de_alias', 'de_child', 'en', 'en_alias', 'en_child', 'fr', 'fr_alias', 'fr_child'];
7373

7474
$this->assertSame($sortedLocales, $this->scanner->scanLocales($this->directory));
7575
}
7676

7777
public function testScanAliases()
7878
{
79-
$sortedAliases = array('de_alias' => 'de', 'en_alias' => 'en', 'fr_alias' => 'fr');
79+
$sortedAliases = ['de_alias' => 'de', 'en_alias' => 'en', 'fr_alias' => 'fr'];
8080

8181
$this->assertSame($sortedAliases, $this->scanner->scanAliases($this->directory));
8282
}
8383

8484
public function testScanParents()
8585
{
86-
$sortedParents = array('de_child' => 'de', 'en_child' => 'en', 'fr_child' => 'fr');
86+
$sortedParents = ['de_child' => 'de', 'en_child' => 'en', 'fr_child' => 'fr'];
8787

8888
$this->assertSame($sortedParents, $this->scanner->scanParents($this->directory));
8989
}

Tests/Locale/LocaleTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ public function testCanonicalize()
3939
*/
4040
public function testComposeLocale()
4141
{
42-
$subtags = array(
42+
$subtags = [
4343
'language' => 'pt',
4444
'script' => 'Latn',
4545
'region' => 'BR',
46-
);
46+
];
4747
$this->call('composeLocale', $subtags);
4848
}
4949

@@ -140,10 +140,10 @@ public function testGetScript()
140140
*/
141141
public function testLookup()
142142
{
143-
$langtag = array(
143+
$langtag = [
144144
'pt-Latn-BR',
145145
'pt-BR',
146-
);
146+
];
147147
$this->call('lookup', $langtag, 'pt-BR-x-priv1');
148148
}
149149

0 commit comments

Comments
 (0)