Update core 8.3.0
This commit is contained in:
parent
da7a7918f8
commit
cd7a898e66
6144 changed files with 132297 additions and 87747 deletions
web/vendor/symfony/validator
|
@ -17,7 +17,7 @@ use Symfony\Component\Validator\ConstraintValidator;
|
|||
/**
|
||||
* @author Michael Hirschler <michael.vhirsch@gmail.com>
|
||||
*
|
||||
* @link https://en.wikipedia.org/wiki/ISO_9362#Structure
|
||||
* @see https://en.wikipedia.org/wiki/ISO_9362#Structure
|
||||
*/
|
||||
class BicValidator extends ConstraintValidator
|
||||
{
|
||||
|
|
|
@ -67,6 +67,10 @@ abstract class Composite extends Constraint
|
|||
|
||||
foreach ($nestedConstraints as $constraint) {
|
||||
if (!$constraint instanceof Constraint) {
|
||||
if (is_object($constraint)) {
|
||||
$constraint = get_class($constraint);
|
||||
}
|
||||
|
||||
throw new ConstraintDefinitionException(sprintf('The value %s is not an instance of Constraint in constraint %s', $constraint, get_class($this)));
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,9 @@ class UrlValidator extends ConstraintValidator
|
|||
\] # an IPv6 address
|
||||
)
|
||||
(:[0-9]+)? # a port (optional)
|
||||
(/?|/\S+|\?\S*|\#\S*) # a /, nothing, a / with something, a query or a fragment
|
||||
(?:/ (?:[\pL\pN\-._\~!$&\'()*+,;=:@]|%%[0-9A-Fa-f]{2})* )* # a path
|
||||
(?:\? (?:[\pL\pN\-._\~!$&\'()*+,;=:@/?]|%%[0-9A-Fa-f]{2})* )? # a query (optional)
|
||||
(?:\# (?:[\pL\pN\-._\~!$&\'()*+,;=:@/?]|%%[0-9A-Fa-f]{2})* )? # a fragment (optional)
|
||||
$~ixu';
|
||||
|
||||
/**
|
||||
|
|
|
@ -319,6 +319,30 @@ class ClassMetadata extends ElementMetadata implements ClassMetadataInterface
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a constraint to the getter of the given property.
|
||||
*
|
||||
* @param string $property The name of the property
|
||||
* @param string $method The name of the getter method
|
||||
* @param Constraint $constraint The constraint
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function addGetterMethodConstraint($property, $method, Constraint $constraint)
|
||||
{
|
||||
if (!isset($this->getters[$property])) {
|
||||
$this->getters[$property] = new GetterMetadata($this->getClassName(), $property, $method);
|
||||
|
||||
$this->addPropertyMetadata($this->getters[$property]);
|
||||
}
|
||||
|
||||
$constraint->addImplicitGroupName($this->getDefaultGroup());
|
||||
|
||||
$this->getters[$property]->addConstraint($constraint);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $property
|
||||
* @param Constraint[] $constraints
|
||||
|
@ -334,6 +358,22 @@ class ClassMetadata extends ElementMetadata implements ClassMetadataInterface
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $property
|
||||
* @param string $method
|
||||
* @param Constraint[] $constraints
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function addGetterMethodConstraints($property, $method, array $constraints)
|
||||
{
|
||||
foreach ($constraints as $constraint) {
|
||||
$this->addGetterMethodConstraint($property, $method, $constraint);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Merges the constraints of the given metadata into this object.
|
||||
*
|
||||
|
@ -346,10 +386,6 @@ class ClassMetadata extends ElementMetadata implements ClassMetadataInterface
|
|||
}
|
||||
|
||||
foreach ($source->getConstrainedProperties() as $property) {
|
||||
if ($this->hasPropertyMetadata($property)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($source->getPropertyMetadata($property) as $member) {
|
||||
$member = clone $member;
|
||||
|
||||
|
|
|
@ -35,25 +35,30 @@ class GetterMetadata extends MemberMetadata
|
|||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $class The class the getter is defined on
|
||||
* @param string $property The property which the getter returns
|
||||
* @param string $class The class the getter is defined on
|
||||
* @param string $property The property which the getter returns
|
||||
* @param string|null $method The method that is called to retrieve the value being validated (null for auto-detection)
|
||||
*
|
||||
* @throws ValidatorException
|
||||
*/
|
||||
public function __construct($class, $property)
|
||||
public function __construct($class, $property, $method = null)
|
||||
{
|
||||
$getMethod = 'get'.ucfirst($property);
|
||||
$isMethod = 'is'.ucfirst($property);
|
||||
$hasMethod = 'has'.ucfirst($property);
|
||||
if (null === $method) {
|
||||
$getMethod = 'get'.ucfirst($property);
|
||||
$isMethod = 'is'.ucfirst($property);
|
||||
$hasMethod = 'has'.ucfirst($property);
|
||||
|
||||
if (method_exists($class, $getMethod)) {
|
||||
$method = $getMethod;
|
||||
} elseif (method_exists($class, $isMethod)) {
|
||||
$method = $isMethod;
|
||||
} elseif (method_exists($class, $hasMethod)) {
|
||||
$method = $hasMethod;
|
||||
} else {
|
||||
throw new ValidatorException(sprintf('Neither of these methods exist in class %s: %s, %s, %s', $class, $getMethod, $isMethod, $hasMethod));
|
||||
if (method_exists($class, $getMethod)) {
|
||||
$method = $getMethod;
|
||||
} elseif (method_exists($class, $isMethod)) {
|
||||
$method = $isMethod;
|
||||
} elseif (method_exists($class, $hasMethod)) {
|
||||
$method = $hasMethod;
|
||||
} else {
|
||||
throw new ValidatorException(sprintf('Neither of these methods exist in class %s: %s, %s, %s', $class, $getMethod, $isMethod, $hasMethod));
|
||||
}
|
||||
} elseif (!method_exists($class, $method)) {
|
||||
throw new ValidatorException(sprintf('The %s() method does not exist in class %s.', $method, $class));
|
||||
}
|
||||
|
||||
parent::__construct($class, $method, $property);
|
||||
|
|
|
@ -79,7 +79,7 @@ class AnnotationLoader implements LoaderInterface
|
|||
$metadata->addConstraint($constraint);
|
||||
} elseif ($constraint instanceof Constraint) {
|
||||
if (preg_match('/^(get|is|has)(.+)$/i', $method->name, $matches)) {
|
||||
$metadata->addGetterConstraint(lcfirst($matches[2]), $constraint);
|
||||
$metadata->addGetterMethodConstraint(lcfirst($matches[2]), $matches[0], $constraint);
|
||||
} else {
|
||||
throw new MappingException(sprintf('The constraint on "%s::%s" cannot be added. Constraints can only be added on methods beginning with "get", "is" or "has".', $className, $method->name));
|
||||
}
|
||||
|
|
6
web/vendor/symfony/validator/composer.json
vendored
6
web/vendor/symfony/validator/composer.json
vendored
|
@ -22,14 +22,14 @@
|
|||
},
|
||||
"require-dev": {
|
||||
"symfony/http-foundation": "~2.3|~3.0.0",
|
||||
"symfony/intl": "~2.7.4|~2.8|~3.0.0",
|
||||
"symfony/yaml": "~2.0,>=2.0.5|~3.0.0",
|
||||
"symfony/intl": "~2.7.25|^2.8.18|~3.2.5",
|
||||
"symfony/yaml": "^2.0.5|~3.0.0",
|
||||
"symfony/config": "~2.2|~3.0.0",
|
||||
"symfony/property-access": "~2.3|~3.0.0",
|
||||
"symfony/expression-language": "~2.4|~3.0.0",
|
||||
"doctrine/annotations": "~1.0",
|
||||
"doctrine/cache": "~1.0",
|
||||
"egulias/email-validator": "~1.2,>=1.2.1"
|
||||
"egulias/email-validator": "^1.2.1"
|
||||
},
|
||||
"suggest": {
|
||||
"doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.",
|
||||
|
|
Reference in a new issue