Skip to content

Commit d4cddac

Browse files
author
Robin Chalas
committed
Merge branch '2.8' into 3.4
* 2.8: [Console] Correct Command::initialize() and InputInterface::bind() phpdoc regarding thrown exceptions [Console] fixed corrupt error output for unknown multibyte short option [Console] fixed PHPDoc for setArgument/setOption in InputInterface [Intl] Blacklist Eurozone and United Nations in Region Data Generator
2 parents b4bbc25 + 86a5d92 commit d4cddac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+23
-198
lines changed

src/Symfony/Component/Console/Command/Command.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,14 @@ protected function interact(InputInterface $input, OutputInterface $output)
173173
}
174174

175175
/**
176-
* Initializes the command just after the input has been validated.
176+
* Initializes the command after the input has been bound and before the input
177+
* is validated.
177178
*
178179
* This is mainly useful when a lot of commands extends one main command
179180
* where some things need to be initialized based on the input arguments and options.
181+
*
182+
* @see InputInterface::bind()
183+
* @see InputInterface::validate()
180184
*/
181185
protected function initialize(InputInterface $input, OutputInterface $output)
182186
{

src/Symfony/Component/Console/Input/ArgvInput.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ private function parseShortOptionSet($name)
121121
$len = \strlen($name);
122122
for ($i = 0; $i < $len; ++$i) {
123123
if (!$this->definition->hasShortcut($name[$i])) {
124-
throw new RuntimeException(sprintf('The "-%s" option does not exist.', $name[$i]));
124+
$encoding = mb_detect_encoding($name, null, true);
125+
throw new RuntimeException(sprintf('The "-%s" option does not exist.', false === $encoding ? $name[$i] : mb_substr($name, $i, 1, $encoding)));
125126
}
126127

127128
$option = $this->definition->getOptionForShortcut($name[$i]);

src/Symfony/Component/Console/Input/InputInterface.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ public function getParameterOption($values, $default = false, $onlyParams = fals
6161

6262
/**
6363
* Binds the current Input instance with the given arguments and options.
64+
*
65+
* @throws RuntimeException
6466
*/
6567
public function bind(InputDefinition $definition);
6668

@@ -92,8 +94,8 @@ public function getArgument($name);
9294
/**
9395
* Sets an argument value by name.
9496
*
95-
* @param string $name The argument name
96-
* @param string $value The argument value
97+
* @param string $name The argument name
98+
* @param string|string[] $value The argument value
9799
*
98100
* @throws InvalidArgumentException When argument given doesn't exist
99101
*/
@@ -129,8 +131,8 @@ public function getOption($name);
129131
/**
130132
* Sets an option value by name.
131133
*
132-
* @param string $name The option name
133-
* @param string|bool $value The option value
134+
* @param string $name The option name
135+
* @param string|string[]|bool $value The option value
134136
*
135137
* @throws InvalidArgumentException When option given doesn't exist
136138
*/

src/Symfony/Component/Console/Tests/Input/ArgvInputTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,11 @@ public function provideInvalidInput()
246246
new InputDefinition(array(new InputArgument('number'))),
247247
'The "-1" option does not exist.',
248248
),
249+
array(
250+
array('cli.php', '-fЩ'),
251+
new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_NONE))),
252+
'The "-Щ" option does not exist.',
253+
),
249254
);
250255
}
251256

src/Symfony/Component/Intl/Data/Generator/RegionDataGenerator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ class RegionDataGenerator extends AbstractDataGenerator
3434
const BOUVET_ISLAND_ID = 'BV';
3535
const HEARD_MCDONALD_ISLANDS_ID = 'HM';
3636
const CLIPPERTON_ISLAND_ID = 'CP';
37+
const EUROZONE_ID = 'EZ';
38+
const UNITED_NATIONS_ID = 'UN';
3739

3840
/**
3941
* Regions excluded from generation.
@@ -43,6 +45,8 @@ class RegionDataGenerator extends AbstractDataGenerator
4345
// Look like countries, but are sub-continents
4446
self::OUTLYING_OCEANIA_REGION_ID => true,
4547
self::EUROPEAN_UNION_ID => true,
48+
self::EUROZONE_ID => true,
49+
self::UNITED_NATIONS_ID => true,
4650
// No longer exists
4751
self::NETHERLANDS_ANTILLES_ID => true,
4852
// Uninhabited islands

src/Symfony/Component/Intl/Resources/data/regions/af.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
"ER": "Eritrea",
7373
"ES": "Spanje",
7474
"ET": "Ethiopië",
75-
"EZ": "Eurosone",
7675
"FI": "Finland",
7776
"FJ": "Fidji",
7877
"FK": "Falklandeilande",
@@ -237,7 +236,6 @@
237236
"UA": "Oekraïne",
238237
"UG": "Uganda",
239238
"UM": "Klein afgeleë eilande van die VSA",
240-
"UN": "Verenigde Nasies",
241239
"US": "Verenigde State van Amerika",
242240
"UY": "Uruguay",
243241
"UZ": "Oesbekistan",

src/Symfony/Component/Intl/Resources/data/regions/am.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
"ER": "ኤርትራ",
7373
"ES": "ስፔን",
7474
"ET": "ኢትዮጵያ",
75-
"EZ": "የአውሮፓ ዞን",
7675
"FI": "ፊንላንድ",
7776
"FJ": "ፊጂ",
7877
"FK": "የፎክላንድ ደሴቶች",
@@ -237,7 +236,6 @@
237236
"UA": "ዩክሬን",
238237
"UG": "ዩጋንዳ",
239238
"UM": "የዩ ኤስ ጠረፍ ላይ ያሉ ደሴቶች",
240-
"UN": "የተባበሩት መንግስታት",
241239
"US": "ዩናይትድ ስቴትስ",
242240
"UY": "ኡራጓይ",
243241
"UZ": "ኡዝቤኪስታን",

src/Symfony/Component/Intl/Resources/data/regions/ar.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
"ER": "إريتريا",
7373
"ES": "إسبانيا",
7474
"ET": "إثيوبيا",
75-
"EZ": "منطقة اليورو",
7675
"FI": "فنلندا",
7776
"FJ": "فيجي",
7877
"FK": "جزر فوكلاند",
@@ -237,7 +236,6 @@
237236
"UA": "أوكرانيا",
238237
"UG": "أوغندا",
239238
"UM": "جزر الولايات المتحدة النائية",
240-
"UN": "الأمم المتحدة",
241239
"US": "الولايات المتحدة",
242240
"UY": "أورغواي",
243241
"UZ": "أوزبكستان",

src/Symfony/Component/Intl/Resources/data/regions/as.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
"ER": "এৰিত্ৰিয়া",
7373
"ES": "স্পেইন",
7474
"ET": "ইথিঅ’পিয়া",
75-
"EZ": "ইউৰোজ’ন",
7675
"FI": "ফিনলেণ্ড",
7776
"FJ": "ফিজি",
7877
"FK": "ফকলেণ্ড দ্বীপপুঞ্জ",
@@ -237,7 +236,6 @@
237236
"UA": "ইউক্ৰেইন",
238237
"UG": "উগাণ্ডা",
239238
"UM": "ইউ. এছ. আউটলায়িং দ্বীপপুঞ্জ",
240-
"UN": "ৰাষ্ট্ৰসংঘ",
241239
"US": "মাৰ্কিন যুক্তৰাষ্ট্ৰ",
242240
"UY": "উৰুগুৱে",
243241
"UZ": "উজবেকিস্তান",

src/Symfony/Component/Intl/Resources/data/regions/az.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
"ER": "Eritreya",
7373
"ES": "İspaniya",
7474
"ET": "Efiopiya",
75-
"EZ": "Avrozona",
7675
"FI": "Finlandiya",
7776
"FJ": "Fici",
7877
"FK": "Folklend adaları",
@@ -237,7 +236,6 @@
237236
"UA": "Ukrayna",
238237
"UG": "Uqanda",
239238
"UM": "ABŞ-a bağlı kiçik adacıqlar",
240-
"UN": "Birləşmiş Millətlər Təşkilatı",
241239
"US": "Amerika Birləşmiş Ştatları",
242240
"UY": "Uruqvay",
243241
"UZ": "Özbəkistan",

0 commit comments

Comments
 (0)