Skip to content

Commit 94e594d

Browse files
committed
Merge branch '2.8' into 3.4
* 2.8: improve docblocks around group sequences [WebProfilerBundle] added a note in the README [Filesystem] Skip tests on readable file when run with root user [FWBundle] Fix an error in WebTestCase::createClient's PHPDoc [HttpFoundation][Security] forward locale and format to subrequests [Console] Send the right exit code to console.terminate listeners Caching missed templates on cache warmup
2 parents 5ce3fa0 + d928358 commit 94e594d

File tree

5 files changed

+35
-43
lines changed

5 files changed

+35
-43
lines changed

GroupSequenceProviderInterface.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Symfony\Component\Validator;
1313

14+
use Symfony\Component\Validator\Constraints\GroupSequence;
15+
1416
/**
1517
* Defines the interface for a group sequence provider.
1618
*/
@@ -20,7 +22,7 @@ interface GroupSequenceProviderInterface
2022
* Returns which validation groups should be used for a certain state
2123
* of the object.
2224
*
23-
* @return array An array of validation groups
25+
* @return string[]|GroupSequence An array of validation groups
2426
*/
2527
public function getGroupSequence();
2628
}

Mapping/ClassMetadata.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ public function getConstrainedProperties()
397397
/**
398398
* Sets the default group sequence for this class.
399399
*
400-
* @param array $groupSequence An array of group names
400+
* @param string[]|GroupSequence $groupSequence An array of group names
401401
*
402402
* @return $this
403403
*

Validator/ContextualValidatorInterface.php

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Validator\Validator;
1313

1414
use Symfony\Component\Validator\Constraint;
15+
use Symfony\Component\Validator\Constraints\GroupSequence;
1516
use Symfony\Component\Validator\ConstraintViolationListInterface;
1617

1718
/**
@@ -39,12 +40,9 @@ public function atPath($path);
3940
* If no constraint is passed, the constraint
4041
* {@link \Symfony\Component\Validator\Constraints\Valid} is assumed.
4142
*
42-
* @param mixed $value The value to validate
43-
* @param Constraint|Constraint[] $constraints The constraint(s) to validate
44-
* against
45-
* @param array|null $groups The validation groups to
46-
* validate. If none is given,
47-
* "Default" is assumed
43+
* @param mixed $value The value to validate
44+
* @param Constraint|Constraint[] $constraints The constraint(s) to validate against
45+
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
4846
*
4947
* @return $this
5048
*/
@@ -54,10 +52,9 @@ public function validate($value, $constraints = null, $groups = null);
5452
* Validates a property of an object against the constraints specified
5553
* for this property.
5654
*
57-
* @param object $object The object
58-
* @param string $propertyName The name of the validated property
59-
* @param array|null $groups The validation groups to validate. If
60-
* none is given, "Default" is assumed
55+
* @param object $object The object
56+
* @param string $propertyName The name of the validated property
57+
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
6158
*
6259
* @return $this
6360
*/
@@ -67,12 +64,10 @@ public function validateProperty($object, $propertyName, $groups = null);
6764
* Validates a value against the constraints specified for an object's
6865
* property.
6966
*
70-
* @param object|string $objectOrClass The object or its class name
71-
* @param string $propertyName The name of the property
72-
* @param mixed $value The value to validate against the
73-
* property's constraints
74-
* @param array|null $groups The validation groups to validate. If
75-
* none is given, "Default" is assumed
67+
* @param object|string $objectOrClass The object or its class name
68+
* @param string $propertyName The name of the property
69+
* @param mixed $value The value to validate against the property's constraints
70+
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
7671
*
7772
* @return $this
7873
*/

Validator/RecursiveContextualValidator.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,9 @@ public function getViolations()
272272
/**
273273
* Normalizes the given group or list of groups to an array.
274274
*
275-
* @param mixed $groups The groups to normalize
275+
* @param string|GroupSequence|(string|GroupSequence)[] $groups The groups to normalize
276276
*
277-
* @return array A group array
277+
* @return (string|GroupSequence)[] A group array
278278
*/
279279
protected function normalizeGroups($groups)
280280
{
@@ -295,7 +295,7 @@ protected function normalizeGroups($groups)
295295
*
296296
* @param object $object The object to cascade
297297
* @param string $propertyPath The current property path
298-
* @param string[] $groups The validated groups
298+
* @param (string|GroupSequence)[] $groups The validated groups
299299
* @param int $traversalStrategy The strategy for traversing the
300300
* cascaded object
301301
* @param ExecutionContextInterface $context The current execution context
@@ -355,10 +355,10 @@ private function validateObject($object, $propertyPath, array $groups, $traversa
355355
* objects are iterated as well. Nested arrays are always iterated,
356356
* regardless of the value of $recursive.
357357
*
358-
* @param iterable $collection The collection
359-
* @param string $propertyPath The current property path
360-
* @param string[] $groups The validated groups
361-
* @param ExecutionContextInterface $context The current execution context
358+
* @param iterable $collection The collection
359+
* @param string $propertyPath The current property path
360+
* @param (string|GroupSequence)[] $groups The validated groups
361+
* @param ExecutionContextInterface $context The current execution context
362362
*
363363
* @see ClassNode
364364
* @see CollectionNode
@@ -424,7 +424,7 @@ private function validateEachObjectIn($collection, $propertyPath, array $groups,
424424
* the object
425425
* @param string $propertyPath The property path leading
426426
* to the object
427-
* @param string[] $groups The groups in which the
427+
* @param (string|GroupSequence)[] $groups The groups in which the
428428
* object should be validated
429429
* @param string[]|null $cascadedGroups The groups in which
430430
* cascaded objects should
@@ -608,7 +608,7 @@ private function validateClassNode($object, $cacheKey, ClassMetadataInterface $m
608608
* value
609609
* @param string $propertyPath The property path leading
610610
* to the value
611-
* @param string[] $groups The groups in which the
611+
* @param (string|GroupSequence)[] $groups The groups in which the
612612
* value should be validated
613613
* @param string[]|null $cascadedGroups The groups in which
614614
* cascaded objects should

Validator/ValidatorInterface.php

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Validator\Validator;
1313

1414
use Symfony\Component\Validator\Constraint;
15+
use Symfony\Component\Validator\Constraints\GroupSequence;
1516
use Symfony\Component\Validator\ConstraintViolationListInterface;
1617
use Symfony\Component\Validator\Context\ExecutionContextInterface;
1718
use Symfony\Component\Validator\Mapping\Factory\MetadataFactoryInterface;
@@ -29,12 +30,9 @@ interface ValidatorInterface extends MetadataFactoryInterface
2930
* If no constraint is passed, the constraint
3031
* {@link \Symfony\Component\Validator\Constraints\Valid} is assumed.
3132
*
32-
* @param mixed $value The value to validate
33-
* @param Constraint|Constraint[] $constraints The constraint(s) to validate
34-
* against
35-
* @param array|null $groups The validation groups to
36-
* validate. If none is given,
37-
* "Default" is assumed
33+
* @param mixed $value The value to validate
34+
* @param Constraint|Constraint[] $constraints The constraint(s) to validate against
35+
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
3836
*
3937
* @return ConstraintViolationListInterface A list of constraint violations
4038
* If the list is empty, validation
@@ -46,10 +44,9 @@ public function validate($value, $constraints = null, $groups = null);
4644
* Validates a property of an object against the constraints specified
4745
* for this property.
4846
*
49-
* @param object $object The object
50-
* @param string $propertyName The name of the validated property
51-
* @param array|null $groups The validation groups to validate. If
52-
* none is given, "Default" is assumed
47+
* @param object $object The object
48+
* @param string $propertyName The name of the validated property
49+
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
5350
*
5451
* @return ConstraintViolationListInterface A list of constraint violations
5552
* If the list is empty, validation
@@ -61,12 +58,10 @@ public function validateProperty($object, $propertyName, $groups = null);
6158
* Validates a value against the constraints specified for an object's
6259
* property.
6360
*
64-
* @param object|string $objectOrClass The object or its class name
65-
* @param string $propertyName The name of the property
66-
* @param mixed $value The value to validate against the
67-
* property's constraints
68-
* @param array|null $groups The validation groups to validate. If
69-
* none is given, "Default" is assumed
61+
* @param object|string $objectOrClass The object or its class name
62+
* @param string $propertyName The name of the property
63+
* @param mixed $value The value to validate against the property's constraints
64+
* @param string|GroupSequence|(string|GroupSequence)[]|null $groups The validation groups to validate. If none is given, "Default" is assumed
7065
*
7166
* @return ConstraintViolationListInterface A list of constraint violations
7267
* If the list is empty, validation

0 commit comments

Comments
 (0)