Skip to content

Commit 07c9701

Browse files
Merge branch '3.4'
* 3.4: [HttpFoundation] refactoring: calculate when need [Serializer] Fix extra attributes when no group specified [Intl] Make intl-data tests pass and save language aliases again [FrameworkBundle][Config] fix: do not add resource checkers for debug=false [DI] Fix "almost-circular" dependencies handling [Console] Fix CommandTester::setInputs() docblock Only enabling validation if it is present Fix displaying errors for bootstrap 4 [Serializer] readd default argument value Fix reference dump for deprecated nodes [PhpUnitBridge] Fixed fatal error in CoverageListener when something goes wrong in Test::setUpBeforeClass [HttpKernel] Let the storage manage the session starts [VarDumper] fix trailling comma when dumping an exception [Validator] Fix TraceableValidator is reset on data collector instantiation Remove useless docblocks [FrameworkBundle] Fix docblocks [PropertyInfo] Remove useless docblocks
2 parents a15040f + 3cdd300 commit 07c9701

28 files changed

+1276
-1133
lines changed

Data/Bundle/Compiler/GenrbCompiler.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,13 @@
2222
*/
2323
class GenrbCompiler implements BundleCompilerInterface
2424
{
25-
/**
26-
* @var string The path to the "genrb" executable
27-
*/
2825
private $genrb;
2926

3027
/**
3128
* Creates a new compiler based on the "genrb" executable.
3229
*
3330
* @param string $genrb Optional. The path to the "genrb" executable
34-
* @param string $envVars Optional. Environment variables to be loaded when
35-
* running "genrb".
31+
* @param string $envVars Optional. Environment variables to be loaded when running "genrb".
3632
*
3733
* @throws RuntimeException if the "genrb" cannot be found
3834
*/

Data/Bundle/Reader/BufferedBundleReader.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,14 @@
2020
*/
2121
class BufferedBundleReader implements BundleReaderInterface
2222
{
23-
/**
24-
* @var BundleReaderInterface
25-
*/
2623
private $reader;
27-
2824
private $buffer;
2925

3026
/**
3127
* Buffers a given reader.
3228
*
3329
* @param BundleReaderInterface $reader The reader to buffer
34-
* @param int $bufferSize the number of entries to store
35-
* in the buffer
30+
* @param int $bufferSize The number of entries to store in the buffer
3631
*/
3732
public function __construct(BundleReaderInterface $reader, $bufferSize)
3833
{

Data/Bundle/Writer/TextBundleWriter.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function write($path, $locale, $data, $fallback = true)
4646
* @param resource $file The file handle to write to
4747
* @param string $bundleName The name of the bundle
4848
* @param mixed $value The value of the node
49-
* @param bool $fallback whether the resource bundle should be merged
49+
* @param bool $fallback Whether the resource bundle should be merged
5050
* with the fallback locale
5151
*
5252
* @see http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt
@@ -66,8 +66,7 @@ private function writeResourceBundle($file, $bundleName, $value, $fallback)
6666
* @param resource $file The file handle to write to
6767
* @param mixed $value The value of the node
6868
* @param int $indentation The number of levels to indent
69-
* @param bool $requireBraces whether to require braces to be printed
70-
* around the value
69+
* @param bool $requireBraces Whether to require braces to be printedaround the value
7170
*
7271
* @see http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt
7372
*/
@@ -153,7 +152,7 @@ private function writeIntVector($file, array $value, $indentation)
153152
*
154153
* @param resource $file The file handle to write to
155154
* @param string $value The value of the node
156-
* @param bool $requireBraces whether to require braces to be printed
155+
* @param bool $requireBraces Whether to require braces to be printed
157156
* around the value
158157
*
159158
* @see http://source.icu-project.org/repos/icu/icuhtml/trunk/design/bnf_rb.txt
@@ -199,7 +198,7 @@ private function writeArray($file, array $value, $indentation)
199198
* @param resource $file The file handle to write to
200199
* @param array|\Traversable $value The value of the node
201200
* @param int $indentation The number of levels to indent
202-
* @param bool $fallback whether the table should be merged
201+
* @param bool $fallback Whether the table should be merged
203202
* with the fallback locale
204203
*
205204
* @throws UnexpectedTypeException when $value is not an array and not a

Data/Generator/AbstractDataGenerator.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,13 @@
2626
*/
2727
abstract class AbstractDataGenerator
2828
{
29-
/**
30-
* @var GenrbCompiler
31-
*/
3229
private $compiler;
33-
34-
/**
35-
* @var string
36-
*/
3730
private $dirName;
3831

3932
public function __construct(GenrbCompiler $compiler, $dirName)
4033
{
4134
$this->compiler = $compiler;
42-
$this->dirName = $dirName;
35+
$this->dirName = (string) $dirName;
4336
}
4437

4538
public function generateData(GeneratorConfig $config)

Data/Generator/CurrencyDataGenerator.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,17 @@
2626
class CurrencyDataGenerator extends AbstractDataGenerator
2727
{
2828
const UNKNOWN_CURRENCY_ID = 'XXX';
29-
3029
const EUROPEAN_COMPOSITE_UNIT_ID = 'XBA';
31-
3230
const EUROPEAN_MONETARY_UNIT_ID = 'XBB';
33-
3431
const EUROPEAN_UNIT_OF_ACCOUNT_XBC_ID = 'XBC';
35-
3632
const EUROPEAN_UNIT_OF_ACCOUNT_XBD_ID = 'XBD';
37-
3833
const TESTING_CURRENCY_CODE_ID = 'XTS';
39-
4034
const ADB_UNIT_OF_ACCOUNT_ID = 'XUA';
41-
4235
const GOLD_ID = 'XAU';
43-
4436
const SILVER_ID = 'XAG';
45-
4637
const PLATINUM_ID = 'XPT';
47-
4838
const PALLADIUM_ID = 'XPD';
49-
5039
const SUCRE_ID = 'XSU';
51-
5240
const SPECIAL_DRAWING_RIGHTS_ID = 'XDR';
5341

5442
/**

Data/Generator/GeneratorConfig.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,18 @@
2222
*/
2323
class GeneratorConfig
2424
{
25-
/**
26-
* @var string
27-
*/
2825
private $sourceDir;
29-
30-
/**
31-
* @var string
32-
*/
3326
private $icuVersion;
3427

3528
/**
3629
* @var BundleWriterInterface[]
3730
*/
3831
private $bundleWriters = array();
3932

33+
/**
34+
* @param string $sourceDir
35+
* @param string $icuVersion
36+
*/
4037
public function __construct($sourceDir, $icuVersion)
4138
{
4239
$this->sourceDir = $sourceDir;

Data/Generator/LanguageDataGenerator.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,20 +157,20 @@ protected function generateDataForMeta(BundleReaderInterface $reader, $tempDir)
157157
return array(
158158
'Version' => $rootBundle['Version'],
159159
'Languages' => $this->languageCodes,
160-
'Aliases' => $metadataBundle['languageAlias'],
160+
'Aliases' => array_map(function (\ResourceBundle $bundle) {
161+
return $bundle['replacement'];
162+
}, iterator_to_array($metadataBundle['alias']['language'])),
161163
'Alpha2ToAlpha3' => $this->generateAlpha2ToAlpha3Mapping($metadataBundle),
162164
);
163165
}
164166

165167
private function generateAlpha2ToAlpha3Mapping(ArrayAccessibleResourceBundle $metadataBundle)
166168
{
167-
// Data structure has changed in ICU 5.5 from "languageAlias" to "alias->language"
168-
$aliases = $metadataBundle['languageAlias'] ?: $metadataBundle['alias']['language'];
169+
$aliases = iterator_to_array($metadataBundle['alias']['language']);
169170
$alpha2ToAlpha3 = array();
170171

171172
foreach ($aliases as $alias => $language) {
172-
// $language is a string before ICU 5.5
173-
$language = is_string($language) ? $language : $language['replacement'];
173+
$language = $language['replacement'];
174174
if (2 === strlen($language) && 3 === strlen($alias)) {
175175
if (isset(self::$preferredAlpha2ToAlpha3Mapping[$language])) {
176176
// Validate to prevent typos
@@ -184,7 +184,7 @@ private function generateAlpha2ToAlpha3Mapping(ArrayAccessibleResourceBundle $me
184184
}
185185

186186
$alpha3 = self::$preferredAlpha2ToAlpha3Mapping[$language];
187-
$alpha2 = is_string($aliases[$alpha3]) ? $aliases[$alpha3] : $aliases[$alpha3]['replacement'];
187+
$alpha2 = $aliases[$alpha3]['replacement'];
188188

189189
if ($language !== $alpha2) {
190190
throw new RuntimeException(

Data/Generator/LocaleDataGenerator.php

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,29 +29,14 @@
2929
*/
3030
class LocaleDataGenerator
3131
{
32-
/**
33-
* @var string
34-
*/
3532
private $dirName;
36-
37-
/**
38-
* @var LanguageDataProvider
39-
*/
4033
private $languageDataProvider;
41-
42-
/**
43-
* @var ScriptDataProvider
44-
*/
4534
private $scriptDataProvider;
46-
47-
/**
48-
* @var RegionDataProvider
49-
*/
5035
private $regionDataProvider;
5136

5237
public function __construct($dirName, LanguageDataProvider $languageDataProvider, ScriptDataProvider $scriptDataProvider, RegionDataProvider $regionDataProvider)
5338
{
54-
$this->dirName = $dirName;
39+
$this->dirName = (string) $dirName;
5540
$this->languageDataProvider = $languageDataProvider;
5641
$this->scriptDataProvider = $scriptDataProvider;
5742
$this->regionDataProvider = $regionDataProvider;

Data/Generator/RegionDataGenerator.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,11 @@
2828
class RegionDataGenerator extends AbstractDataGenerator
2929
{
3030
const UNKNOWN_REGION_ID = 'ZZ';
31-
3231
const OUTLYING_OCEANIA_REGION_ID = 'QO';
33-
3432
const EUROPEAN_UNION_ID = 'EU';
35-
3633
const NETHERLANDS_ANTILLES_ID = 'AN';
37-
3834
const BOUVET_ISLAND_ID = 'BV';
39-
4035
const HEARD_MCDONALD_ISLANDS_ID = 'HM';
41-
4236
const CLIPPERTON_ISLAND_ID = 'CP';
4337

4438
/**

Data/Provider/CurrencyDataProvider.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,11 @@
2525
class CurrencyDataProvider
2626
{
2727
const INDEX_SYMBOL = 0;
28-
2928
const INDEX_NAME = 1;
30-
3129
const INDEX_FRACTION_DIGITS = 0;
32-
3330
const INDEX_ROUNDING_INCREMENT = 1;
3431

35-
/**
36-
* @var string
37-
*/
3832
private $path;
39-
40-
/**
41-
* @var BundleEntryReaderInterface
42-
*/
4333
private $reader;
4434

4535
/**

0 commit comments

Comments
 (0)