function ValidatorBuilder::addYamlMapping
Adds a YAML constraint mapping file to the validator.
Parameters
string $path The path to the mapping file:
Return value
$this
File
-
vendor/
symfony/ validator/ ValidatorBuilder.php, line 122
Class
- ValidatorBuilder
- @author Bernhard Schussek <bschussek@gmail.com>
Namespace
Symfony\Component\ValidatorCode
public function addYamlMapping(string $path) : static {
if (null !== $this->metadataFactory) {
throw new ValidatorException('You cannot add custom mappings after setting a custom metadata factory. Configure your metadata factory instead.');
}
$this->yamlMappings[] = $path;
return $this;
}