bug #10119 [Validator] Minor fix in XmlFileLoader (florianv)

This PR was merged into the 2.3 branch.

Discussion
----------

[Validator] Minor fix in XmlFileLoader

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

An instance of `\SimpleXMLElement` is passed to the `newConstraint` method instead of a string which can lead to weird type juggling issues.

Commits
-------

16b726c [Validator] Minor fix in XmlLoader
This commit is contained in:
Fabien Potencier 2014-01-24 17:40:46 +01:00
commit bd65c9c498
2 changed files with 5 additions and 5 deletions

View File

@ -36,10 +36,10 @@ abstract class AbstractLoader implements LoaderInterface
/**
* Creates a new constraint instance for the given constraint name.
*
* @param string $name The constraint name. Either a constraint relative
* to the default constraint namespace, or a fully
* qualified class name
* @param array $options The constraint options
* @param string $name The constraint name. Either a constraint relative
* to the default constraint namespace, or a fully
* qualified class name
* @param mixed $options The constraint options
*
* @return Constraint
*

View File

@ -105,7 +105,7 @@ class XmlFileLoader extends FileLoader
$options = null;
}
$constraints[] = $this->newConstraint($node['name'], $options);
$constraints[] = $this->newConstraint((string) $node['name'], $options);
}
return $constraints;