minor #28591 [Validator] improve docblocks around group sequences (xabbuh)
This PR was merged into the 2.8 branch.
Discussion
----------
[Validator] improve docblocks around group sequences
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | no
| New feature? |no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #26889
| License | MIT
| Doc PR |
Commits
-------
179a081ee3
improve docblocks around group sequences
This commit is contained in:
commit
3359e62866
@ -211,7 +211,7 @@ class FormValidator extends ConstraintValidator
|
||||
/**
|
||||
* Returns the validation groups of the given form.
|
||||
*
|
||||
* @return array The validation groups
|
||||
* @return string|GroupSequence|(string|GroupSequence)[] The validation groups
|
||||
*/
|
||||
private static function getValidationGroups(FormInterface $form)
|
||||
{
|
||||
@ -246,10 +246,10 @@ class FormValidator extends ConstraintValidator
|
||||
/**
|
||||
* Post-processes the validation groups option for a given form.
|
||||
*
|
||||
* @param array|callable $groups The validation groups
|
||||
* @param FormInterface $form The validated form
|
||||
* @param string|GroupSequence|(string|GroupSequence)[]|callable $groups The validation groups
|
||||
* @param FormInterface $form The validated form
|
||||
*
|
||||
* @return array The validation groups
|
||||
* @return (string|GroupSequence)[] The validation groups
|
||||
*/
|
||||
private static function resolveValidationGroups($groups, FormInterface $form)
|
||||
{
|
||||
|
@ -11,6 +11,8 @@
|
||||
|
||||
namespace Symfony\Component\Validator;
|
||||
|
||||
use Symfony\Component\Validator\Constraints\GroupSequence;
|
||||
|
||||
/**
|
||||
* Defines the interface for a group sequence provider.
|
||||
*/
|
||||
@ -20,7 +22,7 @@ interface GroupSequenceProviderInterface
|
||||
* Returns which validation groups should be used for a certain state
|
||||
* of the object.
|
||||
*
|
||||
* @return array An array of validation groups
|
||||
* @return string[]|GroupSequence An array of validation groups
|
||||
*/
|
||||
public function getGroupSequence();
|
||||
}
|
||||
|
@ -485,7 +485,7 @@ class ClassMetadata extends ElementMetadata implements ClassMetadataInterface
|
||||
/**
|
||||
* Sets the default group sequence for this class.
|
||||
*
|
||||
* @param array $groupSequence An array of group names
|
||||
* @param string[]|GroupSequence $groupSequence An array of group names
|
||||
*
|
||||
* @return $this
|
||||
*
|
||||
|
@ -12,6 +12,7 @@
|
||||
namespace Symfony\Component\Validator\Validator;
|
||||
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
use Symfony\Component\Validator\Constraints\GroupSequence;
|
||||
use Symfony\Component\Validator\ConstraintViolationListInterface;
|
||||
|
||||
/**
|
||||
@ -39,12 +40,9 @@ interface ContextualValidatorInterface
|
||||
* If no constraint is passed, the constraint
|
||||
* {@link \Symfony\Component\Validator\Constraints\Valid} is assumed.
|
||||
*
|
||||
* @param mixed $value The value to validate
|
||||
* @param Constraint|Constraint[] $constraints The constraint(s) to validate
|
||||
* against
|
||||
* @param array|null $groups The validation groups to
|
||||
* validate. If none is given,
|
||||
* "Default" is assumed
|
||||
* @param mixed $value The value to validate
|
||||
* @param Constraint|Constraint[] $constraints The constraint(s) to validate against
|
||||
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
@ -54,10 +52,9 @@ interface ContextualValidatorInterface
|
||||
* Validates a property of an object against the constraints specified
|
||||
* for this property.
|
||||
*
|
||||
* @param object $object The object
|
||||
* @param string $propertyName The name of the validated property
|
||||
* @param array|null $groups The validation groups to validate. If
|
||||
* none is given, "Default" is assumed
|
||||
* @param object $object The object
|
||||
* @param string $propertyName The name of the validated property
|
||||
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
@ -67,12 +64,10 @@ interface ContextualValidatorInterface
|
||||
* Validates a value against the constraints specified for an object's
|
||||
* property.
|
||||
*
|
||||
* @param object|string $objectOrClass The object or its class name
|
||||
* @param string $propertyName The name of the property
|
||||
* @param mixed $value The value to validate against the
|
||||
* property's constraints
|
||||
* @param array|null $groups The validation groups to validate. If
|
||||
* none is given, "Default" is assumed
|
||||
* @param object|string $objectOrClass The object or its class name
|
||||
* @param string $propertyName The name of the property
|
||||
* @param mixed $value The value to validate against the property's constraints
|
||||
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
|
@ -275,9 +275,9 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
|
||||
/**
|
||||
* Normalizes the given group or list of groups to an array.
|
||||
*
|
||||
* @param mixed $groups The groups to normalize
|
||||
* @param string|GroupSequence|(string|GroupSequence)[] $groups The groups to normalize
|
||||
*
|
||||
* @return array A group array
|
||||
* @return (string|GroupSequence)[] A group array
|
||||
*/
|
||||
protected function normalizeGroups($groups)
|
||||
{
|
||||
@ -298,7 +298,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
|
||||
*
|
||||
* @param object $object The object to cascade
|
||||
* @param string $propertyPath The current property path
|
||||
* @param string[] $groups The validated groups
|
||||
* @param (string|GroupSequence)[] $groups The validated groups
|
||||
* @param int $traversalStrategy The strategy for traversing the
|
||||
* cascaded object
|
||||
* @param ExecutionContextInterface $context The current execution context
|
||||
@ -361,7 +361,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
|
||||
*
|
||||
* @param iterable $collection The collection
|
||||
* @param string $propertyPath The current property path
|
||||
* @param string[] $groups The validated groups
|
||||
* @param (string|GroupSequence)[] $groups The validated groups
|
||||
* @param bool $stopRecursion Whether to disable
|
||||
* recursive iteration. For
|
||||
* backwards compatibility
|
||||
@ -441,7 +441,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
|
||||
* the object
|
||||
* @param string $propertyPath The property path leading
|
||||
* to the object
|
||||
* @param string[] $groups The groups in which the
|
||||
* @param (string|GroupSequence)[] $groups The groups in which the
|
||||
* object should be validated
|
||||
* @param string[]|null $cascadedGroups The groups in which
|
||||
* cascaded objects should
|
||||
@ -630,7 +630,7 @@ class RecursiveContextualValidator implements ContextualValidatorInterface
|
||||
* value
|
||||
* @param string $propertyPath The property path leading
|
||||
* to the value
|
||||
* @param string[] $groups The groups in which the
|
||||
* @param (string|GroupSequence)[] $groups The groups in which the
|
||||
* value should be validated
|
||||
* @param string[]|null $cascadedGroups The groups in which
|
||||
* cascaded objects should
|
||||
|
@ -12,6 +12,7 @@
|
||||
namespace Symfony\Component\Validator\Validator;
|
||||
|
||||
use Symfony\Component\Validator\Constraint;
|
||||
use Symfony\Component\Validator\Constraints\GroupSequence;
|
||||
use Symfony\Component\Validator\ConstraintViolationListInterface;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
use Symfony\Component\Validator\Mapping\Factory\MetadataFactoryInterface;
|
||||
@ -29,12 +30,9 @@ interface ValidatorInterface extends MetadataFactoryInterface
|
||||
* If no constraint is passed, the constraint
|
||||
* {@link \Symfony\Component\Validator\Constraints\Valid} is assumed.
|
||||
*
|
||||
* @param mixed $value The value to validate
|
||||
* @param Constraint|Constraint[] $constraints The constraint(s) to validate
|
||||
* against
|
||||
* @param array|null $groups The validation groups to
|
||||
* validate. If none is given,
|
||||
* "Default" is assumed
|
||||
* @param mixed $value The value to validate
|
||||
* @param Constraint|Constraint[] $constraints The constraint(s) to validate against
|
||||
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
|
||||
*
|
||||
* @return ConstraintViolationListInterface A list of constraint violations
|
||||
* If the list is empty, validation
|
||||
@ -46,10 +44,9 @@ interface ValidatorInterface extends MetadataFactoryInterface
|
||||
* Validates a property of an object against the constraints specified
|
||||
* for this property.
|
||||
*
|
||||
* @param object $object The object
|
||||
* @param string $propertyName The name of the validated property
|
||||
* @param array|null $groups The validation groups to validate. If
|
||||
* none is given, "Default" is assumed
|
||||
* @param object $object The object
|
||||
* @param string $propertyName The name of the validated property
|
||||
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
|
||||
*
|
||||
* @return ConstraintViolationListInterface A list of constraint violations
|
||||
* If the list is empty, validation
|
||||
@ -61,12 +58,10 @@ interface ValidatorInterface extends MetadataFactoryInterface
|
||||
* Validates a value against the constraints specified for an object's
|
||||
* property.
|
||||
*
|
||||
* @param object|string $objectOrClass The object or its class name
|
||||
* @param string $propertyName The name of the property
|
||||
* @param mixed $value The value to validate against the
|
||||
* property's constraints
|
||||
* @param array|null $groups The validation groups to validate. If
|
||||
* none is given, "Default" is assumed
|
||||
* @param object|string $objectOrClass The object or its class name
|
||||
* @param string $propertyName The name of the property
|
||||
* @param mixed $value The value to validate against the property's constraints
|
||||
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
|
||||
*
|
||||
* @return ConstraintViolationListInterface A list of constraint violations
|
||||
* If the list is empty, validation
|
||||
|
Reference in New Issue
Block a user