improve docblocks around group sequences
This commit is contained in:
parent
7c87dc9720
commit
179a081ee3
@ -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 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;
|
||||
|
||||
/**
|
||||
@ -40,11 +41,8 @@ interface ContextualValidatorInterface
|
||||
* {@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 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
|
||||
*/
|
||||
@ -56,8 +54,7 @@ interface ContextualValidatorInterface
|
||||
*
|
||||
* @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 string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
@ -69,10 +66,8 @@ interface ContextualValidatorInterface
|
||||
*
|
||||
* @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 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;
|
||||
@ -30,11 +31,8 @@ interface ValidatorInterface extends MetadataFactoryInterface
|
||||
* {@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 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
|
||||
@ -48,8 +46,7 @@ interface ValidatorInterface extends MetadataFactoryInterface
|
||||
*
|
||||
* @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 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
|
||||
@ -63,10 +60,8 @@ interface ValidatorInterface extends MetadataFactoryInterface
|
||||
*
|
||||
* @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 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