Skip to content

Commit

Permalink
[OptionsResolver] replaced some exception messages
Browse files Browse the repository at this point in the history
  • Loading branch information
issei-m authored and fabpot committed Jan 25, 2015
1 parent db4eb0f commit 5e5ba39
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/Symfony/Component/OptionsResolver/OptionsResolver.php
Expand Up @@ -409,7 +409,7 @@ public function setNormalizer($option, \Closure $normalizer)

if (!isset($this->defined[$option])) {
throw new UndefinedOptionsException(sprintf(
'The option "%s" does not exist. Known options are: "%s".',
'The option "%s" does not exist. Defined options are: "%s".',
$option,
implode('", "', array_keys($this->defined))
));
Expand Down Expand Up @@ -473,7 +473,7 @@ public function setAllowedValues($option, $allowedValues = null)

if (!isset($this->defined[$option])) {
throw new UndefinedOptionsException(sprintf(
'The option "%s" does not exist. Known options are: "%s".',
'The option "%s" does not exist. Defined options are: "%s".',
$option,
implode('", "', array_keys($this->defined))
));
Expand Down Expand Up @@ -527,7 +527,7 @@ public function addAllowedValues($option, $allowedValues = null)

if (!isset($this->defined[$option])) {
throw new UndefinedOptionsException(sprintf(
'The option "%s" does not exist. Known options are: "%s".',
'The option "%s" does not exist. Defined options are: "%s".',
$option,
implode('", "', array_keys($this->defined))
));
Expand Down Expand Up @@ -579,7 +579,7 @@ public function setAllowedTypes($option, $allowedTypes = null)

if (!isset($this->defined[$option])) {
throw new UndefinedOptionsException(sprintf(
'The option "%s" does not exist. Known options are: "%s".',
'The option "%s" does not exist. Defined options are: "%s".',
$option,
implode('", "', array_keys($this->defined))
));
Expand Down Expand Up @@ -627,7 +627,7 @@ public function addAllowedTypes($option, $allowedTypes = null)

if (!isset($this->defined[$option])) {
throw new UndefinedOptionsException(sprintf(
'The option "%s" does not exist. Known options are: "%s".',
'The option "%s" does not exist. Defined options are: "%s".',
$option,
implode('", "', array_keys($this->defined))
));
Expand Down Expand Up @@ -742,7 +742,7 @@ public function resolve(array $options = array())
ksort($diff);

throw new UndefinedOptionsException(sprintf(
(count($diff) > 1 ? 'The options "%s" do not exist.' : 'The option "%s" does not exist.').' Known options are: "%s".',
(count($diff) > 1 ? 'The options "%s" do not exist.' : 'The option "%s" does not exist.').' Defined options are: "%s".',
implode('", "', array_keys($diff)),
implode('", "', array_keys($clone->defined))
));
Expand Down Expand Up @@ -808,7 +808,7 @@ public function offsetGet($option)
if (!array_key_exists($option, $this->defaults)) {
if (!isset($this->defined[$option])) {
throw new NoSuchOptionException(sprintf(
'The option "%s" does not exist. Known options are: "%s".',
'The option "%s" does not exist. Defined options are: "%s".',
$option,
implode('", "', array_keys($this->defined))
));
Expand Down
Expand Up @@ -206,7 +206,8 @@ public function testResolveLazyReplaceDefaults()
}

/**
* @expectedException \Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException
* @expectedException \Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException
* @expectedExceptionMessage The option "foo" does not exist. Defined options are: "one", "three", "two".
*/
public function testResolveFailsIfNonExistingOption()
{
Expand Down

0 comments on commit 5e5ba39

Please sign in to comment.