8000 merged branch Nanocom/master (PR #4609) · lauris/symfony@363d382 · GitHub
[go: up one dir, main page]

Skip to content

Commit 363d382

Browse files
committed
merged branch Nanocom/master (PR symfony#4609)
Commits ------- 60d371b InputDefinition: Fixed unit tests c099763 InputDefinition: corrected grammar mistakes and added a @throws declaration Discussion ---------- [Console] InputDefinition: corrected grammar mistakes and added a missing @throws declaration --------------------------------------------------------------------------- by travisbot at 2012-06-18T21:46:59Z This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1650681) (merged c099763 into 086ff48). --------------------------------------------------------------------------- by Nanocom at 2012-06-18T21:58:32Z Wooops, forgot to change unit tests :) Doing this right now --------------------------------------------------------------------------- by travisbot at 2012-06-18T22:18:42Z This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1650917) (merged 60d371b into 086ff48).
2 parents 086ff48 + 60d371b commit 363d382

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public function addArguments($arguments = array())
113113
public function addArgument(InputArgument $argument)
114114
{
115115
if (isset($this->arguments[$argument->getName()])) {
116-
throw new \LogicException(sprintf('An argument with name "%s" already exist.', $argument->getName()));
116+
throw new \LogicException(sprintf('An argument with name "%s" already exists.', $argument->getName()));
117117
}
118118

119119
if ($this->hasAnArrayArgument) {
@@ -262,9 +262,9 @@ public function addOptions($options = array())
262262
public function addOption(InputOption $option)
263263
{
264264
if (isset($this->options[$option->getName()]) && !$option->equals($this->options[$option->getName()])) {
265-
throw new \LogicException(sprintf('An option named "%s" already exist.', $option->getName()));
265+
throw new \LogicException(sprintf('An option named "%s" already exists.', $option->getName()));
266266
} elseif (isset($this->shortcuts[$option->getShortcut()]) && !$option->equals($this->options[$this->shortcuts[$option->getShortcut()]])) {
267-
throw new \LogicException(sprintf('An option with shortcut "%s" already exist.', $option->getShortcut()));
267+
throw new \LogicException(sprintf('An option with shortcut "%s" already exists.', $option->getShortcut()));
268268
}
269269

270270
$this->options[$option->getName()] = $option;
@@ -280,6 +280,8 @@ public function addOption(InputOption $option)
280280
*
281281
* @return InputOption A InputOption object
282282
*
283+
* @throws \InvalidArgumentException When option given doesn't exist
284+
*
283285
* @api
284286
*/
285287
public function getOption($name)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function testAddArgument()
8484
$this->fail('->addArgument() throws a Exception if another argument is already registered with the same name');
8585
} catch (\Exception $e) {
8686
$this->assertInstanceOf('\Exception', $e, '->addArgument() throws a Exception if another argument is already registered with the same name');
87-
$this->assertEquals('An argument with name "foo" already exist.', $e->getMessage());
87+
$this->assertEquals('An argument with name "foo" already exists.', $e->getMessage());
8888
}
8989

9090
// cannot add a parameter after an array parameter
@@ -215,14 +215,14 @@ public function testAddOption()
215215
$this->fail('->addOption() throws a Exception if the another option is already registered with the same name');
216216
} catch (\Exception $e) {
217217
$this->assertInstanceOf('\Exception', $e, '->addOption() throws a Exception if the another option is already registered with the same name');
218-
$this->assertEquals('An option named "foo" already exist.', $e->getMessage());
218+
$this->assertEquals('An option named "foo" already exists.', $e->getMessage());
219219
}
220220
try {
221221
$definition->addOption($this->foo1);
222222
$this->fail('->addOption() throws a Exception if the another option is already registered with the same shortcut');
223223
} catch (\Exception $e) {
224224
$this->assertInstanceOf('\Exception', $e, '->addOption() throws a Exception if the another option is already registered with the same shortcut');
225-
$this->assertEquals('An option with shortcut "f" already exist.', $e->getMessage());
225+
$this->assertEquals('An option with shortcut "f" already exists.', $e->getMessage());
226226
}
227227
}
228228

0 commit comments

Comments
 (0)
0