Upgrade 1-11.38

This commit is contained in:
xesmyd
2026-03-30 14:10:30 +02:00
parent f2a7e6d1fc
commit ac648ef29d
24665 changed files with 69682 additions and 2205004 deletions
@@ -23,11 +23,11 @@ use Symfony\Component\Validator\Exception\UnsupportedMetadataException;
use Symfony\Component\Validator\Exception\ValidatorException;
use Symfony\Component\Validator\Mapping\CascadingStrategy;
use Symfony\Component\Validator\Mapping\ClassMetadataInterface;
use Symfony\Component\Validator\Mapping\Factory\MetadataFactoryInterface;
use Symfony\Component\Validator\Mapping\GenericMetadata;
use Symfony\Component\Validator\Mapping\MetadataInterface;
use Symfony\Component\Validator\Mapping\PropertyMetadataInterface;
use Symfony\Component\Validator\Mapping\TraversalStrategy;
use Symfony\Component\Validator\Mapping\Factory\MetadataFactoryInterface;
use Symfony\Component\Validator\ObjectInitializerInterface;
use Symfony\Component\Validator\Util\PropertyPath;
@@ -99,7 +99,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
if (null !== $constraints) {
// You can pass a single constraint or an array of constraints
// Make sure to deal with an array in the rest of the code
if (!is_array($constraints)) {
if (!\is_array($constraints)) {
$constraints = array($constraints);
}
@@ -109,7 +109,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
$this->validateGenericNode(
$value,
$previousObject,
is_object($value) ? spl_object_hash($value) : null,
\is_object($value) ? spl_object_hash($value) : null,
$metadata,
$this->defaultPropertyPath,
$groups,
@@ -130,7 +130,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
// If an object is passed without explicit constraints, validate that
// object against the constraints defined for the object's class
if (is_object($value)) {
if (\is_object($value)) {
$this->validateObject(
$value,
$this->defaultPropertyPath,
@@ -147,7 +147,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
// If an array is passed without explicit constraints, validate each
// object in the array
if (is_array($value)) {
if (\is_array($value)) {
$this->validateEachObjectIn(
$value,
$this->defaultPropertyPath,
@@ -164,7 +164,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
throw new RuntimeException(sprintf(
'Cannot validate values of type "%s" automatically. Please '.
'provide a constraint.',
gettype($value)
\gettype($value)
));
}
@@ -180,7 +180,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
'The metadata factory should return instances of '.
'"\Symfony\Component\Validator\Mapping\ClassMetadataInterface", '.
'got: "%s".',
is_object($classMetadata) ? get_class($classMetadata) : gettype($classMetadata)
\is_object($classMetadata) ? \get_class($classMetadata) : \gettype($classMetadata)
));
}
@@ -201,7 +201,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
$this->validateGenericNode(
$propertyValue,
$object,
$cacheKey.':'.get_class($object).':'.$propertyName,
$cacheKey.':'.\get_class($object).':'.$propertyName,
$propertyMetadata,
$propertyPath,
$groups,
@@ -229,16 +229,16 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
'The metadata factory should return instances of '.
'"\Symfony\Component\Validator\Mapping\ClassMetadataInterface", '.
'got: "%s".',
is_object($classMetadata) ? get_class($classMetadata) : gettype($classMetadata)
\is_object($classMetadata) ? \get_class($classMetadata) : \gettype($classMetadata)
));
}
$propertyMetadatas = $classMetadata->getPropertyMetadata($propertyName);
$groups = $groups ? $this->normalizeGroups($groups) : $this->defaultGroups;
if (is_object($objectOrClass)) {
if (\is_object($objectOrClass)) {
$object = $objectOrClass;
$class = get_class($object);
$class = \get_class($object);
$cacheKey = spl_object_hash($objectOrClass);
$propertyPath = PropertyPath::append($this->defaultPropertyPath, $propertyName);
} else {
@@ -292,7 +292,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
*/
protected function normalizeGroups($groups)
{
if (is_array($groups)) {
if (\is_array($groups)) {
return $groups;
}
@@ -332,7 +332,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
'The metadata factory should return instances of '.
'"Symfony\Component\Validator\Mapping\ClassMetadataInterface", '.
'got: "%s".',
is_object($classMetadata) ? get_class($classMetadata) : gettype($classMetadata)
\is_object($classMetadata) ? \get_class($classMetadata) : \gettype($classMetadata)
));
}
@@ -385,7 +385,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
private function validateEachObjectIn($collection, $propertyPath, array $groups, ExecutionContextInterface $context)
{
foreach ($collection as $key => $value) {
if (is_array($value)) {
if (\is_array($value)) {
// Arrays are always cascaded, independent of the specified
// traversal strategy
$this->validateEachObjectIn(
@@ -399,7 +399,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
}
// Scalar and null values in the collection are ignored
if (is_object($value)) {
if (\is_object($value)) {
$this->validateObject(
$value,
$propertyPath.'['.$key.']',
@@ -479,7 +479,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
$defaultOverridden = false;
// Use the object hash for group sequences
$groupHash = is_object($group) ? spl_object_hash($group) : $group;
$groupHash = \is_object($group) ? spl_object_hash($group) : $group;
if ($context->isGroupValidated($cacheKey, $groupHash)) {
// Skip this group when validating the properties and when
@@ -544,7 +544,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
// If no more groups should be validated for the property nodes,
// we can safely quit
if (0 === count($groups)) {
if (0 === \count($groups)) {
return;
}
@@ -559,7 +559,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
'The property metadata instances should implement '.
'"Symfony\Component\Validator\Mapping\PropertyMetadataInterface", '.
'got: "%s".',
is_object($propertyMetadata) ? get_class($propertyMetadata) : gettype($propertyMetadata)
\is_object($propertyMetadata) ? \get_class($propertyMetadata) : \gettype($propertyMetadata)
));
}
@@ -568,7 +568,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
$this->validateGenericNode(
$propertyValue,
$object,
$cacheKey.':'.get_class($object).':'.$propertyName,
$cacheKey.':'.\get_class($object).':'.$propertyName,
$propertyMetadata,
PropertyPath::append($propertyPath, $propertyName),
$groups,
@@ -600,7 +600,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
throw new ConstraintDefinitionException(sprintf(
'Traversal was enabled for "%s", but this class '.
'does not implement "\Traversable".',
get_class($object)
\get_class($object)
));
}
@@ -675,7 +675,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
$this->validateInGroup($value, $cacheKey, $metadata, $group, $context);
}
if (0 === count($groups)) {
if (0 === \count($groups)) {
return;
}
@@ -686,7 +686,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
$cascadingStrategy = $metadata->getCascadingStrategy();
// Quit unless we have an array or a cascaded object
if (!is_array($value) && !($cascadingStrategy & CascadingStrategy::CASCADE)) {
if (!\is_array($value) && !($cascadingStrategy & CascadingStrategy::CASCADE)) {
return;
}
@@ -699,9 +699,9 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
// The $cascadedGroups property is set, if the "Default" group is
// overridden by a group sequence
// See validateClassNode()
$cascadedGroups = null !== $cascadedGroups && count($cascadedGroups) > 0 ? $cascadedGroups : $groups;
$cascadedGroups = null !== $cascadedGroups && \count($cascadedGroups) > 0 ? $cascadedGroups : $groups;
if (is_array($value)) {
if (\is_array($value)) {
// Arrays are always traversed, independent of the specified
// traversal strategy
$this->validateEachObjectIn(
@@ -757,7 +757,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
*/
private function stepThroughGroupSequence($value, $object, $cacheKey, MetadataInterface $metadata = null, $propertyPath, $traversalStrategy, GroupSequence $groupSequence, $cascadedGroup, ExecutionContextInterface $context)
{
$violationCount = count($context->getViolations());
$violationCount = \count($context->getViolations());
$cascadedGroups = $cascadedGroup ? array($cascadedGroup) : null;
foreach ($groupSequence->groups as $groupInSequence) {
@@ -789,7 +789,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
}
// Abort sequence validation if a violation was generated
if (count($context->getViolations()) > $violationCount) {
if (\count($context->getViolations()) > $violationCount) {
break;
}
}