diff --git a/src/Symfony/Bridge/Doctrine/Validator/DoctrineInitializer.php b/src/Symfony/Bridge/Doctrine/Validator/DoctrineInitializer.php index 010c051581e7..3b482565a8df 100644 --- a/src/Symfony/Bridge/Doctrine/Validator/DoctrineInitializer.php +++ b/src/Symfony/Bridge/Doctrine/Validator/DoctrineInitializer.php @@ -28,7 +28,7 @@ public function __construct(ManagerRegistry $registry) $this->registry = $registry; } - public function initialize($object) + public function initialize(object $object) { $manager = $this->registry->getManagerForClass(\get_class($object)); if (null !== $manager) { diff --git a/src/Symfony/Component/Validator/ConstraintViolationList.php b/src/Symfony/Component/Validator/ConstraintViolationList.php index c30ee57cb268..d5bedd21e2be 100644 --- a/src/Symfony/Component/Validator/ConstraintViolationList.php +++ b/src/Symfony/Component/Validator/ConstraintViolationList.php @@ -72,7 +72,7 @@ public function addAll(ConstraintViolationListInterface $otherList) /** * {@inheritdoc} */ - public function get($offset) + public function get(int $offset) { if (!isset($this->violations[$offset])) { throw new \OutOfBoundsException(sprintf('The offset "%s" does not exist.', $offset)); @@ -84,7 +84,7 @@ public function get($offset) /** * {@inheritdoc} */ - public function has($offset) + public function has(int $offset) { return isset($this->violations[$offset]); } @@ -92,7 +92,7 @@ public function has($offset) /** * {@inheritdoc} */ - public function set($offset, ConstraintViolationInterface $violation) + public function set(int $offset, ConstraintViolationInterface $violation) { $this->violations[$offset] = $violation; } @@ -100,7 +100,7 @@ public function set($offset, ConstraintViolationInterface $violation) /** * {@inheritdoc} */ - public function remove($offset) + public function remove(int $offset) { unset($this->violations[$offset]); } diff --git a/src/Symfony/Component/Validator/ConstraintViolationListInterface.php b/src/Symfony/Component/Validator/ConstraintViolationListInterface.php index 47e986f51e50..d253f688d34a 100644 --- a/src/Symfony/Component/Validator/ConstraintViolationListInterface.php +++ b/src/Symfony/Component/Validator/ConstraintViolationListInterface.php @@ -37,7 +37,7 @@ public function addAll(self $otherList); * * @throws \OutOfBoundsException if the offset does not exist */ - public function get($offset); + public function get(int $offset); /** * Returns whether the given offset exists. @@ -46,7 +46,7 @@ public function get($offset); * * @return bool Whether the offset exists */ - public function has($offset); + public function has(int $offset); /** * Sets a violation at a given offset. @@ -54,12 +54,12 @@ public function has($offset); * @param int $offset The violation offset * @param ConstraintViolationInterface $violation The violation */ - public function set($offset, ConstraintViolationInterface $violation); + public function set(int $offset, ConstraintViolationInterface $violation); /** * Removes a violation at a given offset. * * @param int $offset The offset to remove */ - public function remove($offset); + public function remove(int $offset); } diff --git a/src/Symfony/Component/Validator/Context/ExecutionContext.php b/src/Symfony/Component/Validator/Context/ExecutionContext.php index bfb767a0d4fb..56c38d160eb3 100644 --- a/src/Symfony/Component/Validator/Context/ExecutionContext.php +++ b/src/Symfony/Component/Validator/Context/ExecutionContext.php @@ -143,7 +143,7 @@ public function __construct(ValidatorInterface $validator, $root, TranslatorInte /** * {@inheritdoc} */ - public function setNode($value, $object, MetadataInterface $metadata = null, $propertyPath) + public function setNode($value, ?object $object, MetadataInterface $metadata = null, string $propertyPath) { $this->value = $value; $this->object = $object; @@ -154,7 +154,7 @@ public function setNode($value, $object, MetadataInterface $metadata = null, $pr /** * {@inheritdoc} */ - public function setGroup($group) + public function setGroup(?string $group) { $this->group = $group; } @@ -170,7 +170,7 @@ public function setConstraint(Constraint $constraint) /** * {@inheritdoc} */ - public function addViolation($message, array $parameters = []) + public function addViolation(string $message, array $parameters = []) { $this->violations->add(new ConstraintViolation( $this->translator->trans($message, $parameters, $this->translationDomain), @@ -188,7 +188,7 @@ public function addViolation($message, array $parameters = []) /** * {@inheritdoc} */ - public function buildViolation($message, array $parameters = []) + public function buildViolation(string $message, array $parameters = []) { return new ConstraintViolationBuilder( $this->violations, @@ -283,7 +283,7 @@ public function getPropertyName() /** * {@inheritdoc} */ - public function getPropertyPath($subPath = '') + public function getPropertyPath(string $subPath = '') { return PropertyPath::append($this->propertyPath, $subPath); } @@ -291,7 +291,7 @@ public function getPropertyPath($subPath = '') /** * {@inheritdoc} */ - public function markGroupAsValidated($cacheKey, $groupHash) + public function markGroupAsValidated(string $cacheKey, string $groupHash) { if (!isset($this->validatedObjects[$cacheKey])) { $this->validatedObjects[$cacheKey] = []; @@ -303,7 +303,7 @@ public function markGroupAsValidated($cacheKey, $groupHash) /** * {@inheritdoc} */ - public function isGroupValidated($cacheKey, $groupHash) + public function isGroupValidated(string $cacheKey, string $groupHash) { return isset($this->validatedObjects[$cacheKey][$groupHash]); } @@ -311,7 +311,7 @@ public function isGroupValidated($cacheKey, $groupHash) /** * {@inheritdoc} */ - public function markConstraintAsValidated($cacheKey, $constraintHash) + public function markConstraintAsValidated(string $cacheKey, string $constraintHash) { $this->validatedConstraints[$cacheKey.':'.$constraintHash] = true; } @@ -319,7 +319,7 @@ public function markConstraintAsValidated($cacheKey, $constraintHash) /** * {@inheritdoc} */ - public function isConstraintValidated($cacheKey, $constraintHash) + public function isConstraintValidated(string $cacheKey, string $constraintHash) { return isset($this->validatedConstraints[$cacheKey.':'.$constraintHash]); } @@ -327,7 +327,7 @@ public function isConstraintValidated($cacheKey, $constraintHash) /** * {@inheritdoc} */ - public function markObjectAsInitialized($cacheKey) + public function markObjectAsInitialized(string $cacheKey) { $this->initializedObjects[$cacheKey] = true; } @@ -335,7 +335,7 @@ public function markObjectAsInitialized($cacheKey) /** * {@inheritdoc} */ - public function isObjectInitialized($cacheKey) + public function isObjectInitialized(string $cacheKey) { return isset($this->initializedObjects[$cacheKey]); } diff --git a/src/Symfony/Component/Validator/Context/ExecutionContextInterface.php b/src/Symfony/Component/Validator/Context/ExecutionContextInterface.php index 2ab625b1561a..0f02e1f69486 100644 --- a/src/Symfony/Component/Validator/Context/ExecutionContextInterface.php +++ b/src/Symfony/Component/Validator/Context/ExecutionContextInterface.php @@ -67,7 +67,7 @@ interface ExecutionContextInterface * @param string $message The error message * @param array $params The parameters substituted in the error message */ - public function addViolation($message, array $params = []); + public function addViolation(string $message, array $params = []); /** * Returns a builder for adding a violation with extended information. @@ -86,7 +86,7 @@ public function addViolation($message, array $params = []); * * @return ConstraintViolationBuilderInterface The violation builder */ - public function buildViolation($message, array $parameters = []); + public function buildViolation(string $message, array $parameters = []); /** * Returns the validator. @@ -133,7 +133,7 @@ public function getObject(); * @internal Used by the validator engine. Should not be called by user * code. */ - public function setNode($value, $object, MetadataInterface $metadata = null, $propertyPath); + public function setNode($value, ?object $object, MetadataInterface $metadata = null, string $propertyPath); /** * Sets the currently validated group. @@ -143,7 +143,7 @@ public function setNode($value, $object, MetadataInterface $metadata = null, $pr * @internal Used by the validator engine. Should not be called by user * code. */ - public function setGroup($group); + public function setGroup(?string $group); /** * Sets the currently validated constraint. @@ -165,7 +165,7 @@ public function setConstraint(Constraint $constraint); * @internal Used by the validator engine. Should not be called by user * code. */ - public function markGroupAsValidated($cacheKey, $groupHash); + public function markGroupAsValidated(string $cacheKey, string $groupHash); /** * Returns whether an object was validated in a specific validation group. @@ -180,7 +180,7 @@ public function markGroupAsValidated($cacheKey, $groupHash); * @internal Used by the validator engine. Should not be called by user * code. */ - public function isGroupValidated($cacheKey, $groupHash); + public function isGroupValidated(string $cacheKey, string $groupHash); /** * Marks a constraint as validated for an object. @@ -191,7 +191,7 @@ public function isGroupValidated($cacheKey, $groupHash); * @internal Used by the validator engine. Should not be called by user * code. */ - public function markConstraintAsValidated($cacheKey, $constraintHash); + public function markConstraintAsValidated(string $cacheKey, string $constraintHash); /** * Returns whether a constraint was validated for an object. @@ -204,7 +204,7 @@ public function markConstraintAsValidated($cacheKey, $constraintHash); * @internal Used by the validator engine. Should not be called by user * code. */ - public function isConstraintValidated($cacheKey, $constraintHash); + public function isConstraintValidated(string $cacheKey, string $constraintHash); /** * Marks that an object was initialized. @@ -216,7 +216,7 @@ public function isConstraintValidated($cacheKey, $constraintHash); * * @see ObjectInitializerInterface */ - public function markObjectAsInitialized($cacheKey); + public function markObjectAsInitialized(string $cacheKey); /** * Returns whether an object was initialized. @@ -230,7 +230,7 @@ public function markObjectAsInitialized($cacheKey); * * @see ObjectInitializerInterface */ - public function isObjectInitialized($cacheKey); + public function isObjectInitialized(string $cacheKey); /** * Returns the violations generated by the validator so far. @@ -340,5 +340,5 @@ public function getPropertyName(); * string if the validator is currently validating the * root value of the validation graph. */ - public function getPropertyPath($subPath = ''); + public function getPropertyPath(string $subPath = ''); } diff --git a/src/Symfony/Component/Validator/Mapping/Cache/CacheInterface.php b/src/Symfony/Component/Validator/Mapping/Cache/CacheInterface.php index f770f4615407..cf2541deb38e 100644 --- a/src/Symfony/Component/Validator/Mapping/Cache/CacheInterface.php +++ b/src/Symfony/Component/Validator/Mapping/Cache/CacheInterface.php @@ -25,7 +25,7 @@ interface CacheInterface * * @param string $class */ - public function has($class); + public function has(string $class); /** * Returns the metadata for the given class from the cache. @@ -34,7 +34,7 @@ public function has($class); * * @return ClassMetadata|false A ClassMetadata instance or false on miss */ - public function read($class); + public function read(string $class); /** * Stores a class metadata in the cache. diff --git a/src/Symfony/Component/Validator/Mapping/Cache/DoctrineCache.php b/src/Symfony/Component/Validator/Mapping/Cache/DoctrineCache.php index 2f54019328df..17b46e9823a3 100644 --- a/src/Symfony/Component/Validator/Mapping/Cache/DoctrineCache.php +++ b/src/Symfony/Component/Validator/Mapping/Cache/DoctrineCache.php @@ -36,7 +36,7 @@ public function setCache(Cache $cache) /** * {@inheritdoc} */ - public function has($class): bool + public function has(string $class): bool { return $this->cache->contains($class); } @@ -44,7 +44,7 @@ public function has($class): bool /** * {@inheritdoc} */ - public function read($class) + public function read(string $class) { return $this->cache->fetch($class); } diff --git a/src/Symfony/Component/Validator/Mapping/Cache/Psr6Cache.php b/src/Symfony/Component/Validator/Mapping/Cache/Psr6Cache.php index 7d1cdd80034c..e913e280e682 100644 --- a/src/Symfony/Component/Validator/Mapping/Cache/Psr6Cache.php +++ b/src/Symfony/Component/Validator/Mapping/Cache/Psr6Cache.php @@ -31,7 +31,7 @@ public function __construct(CacheItemPoolInterface $cacheItemPool) /** * {@inheritdoc} */ - public function has($class) + public function has(string $class) { return $this->cacheItemPool->hasItem($this->escapeClassName($class)); } @@ -39,7 +39,7 @@ public function has($class) /** * {@inheritdoc} */ - public function read($class) + public function read(string $class) { $item = $this->cacheItemPool->getItem($this->escapeClassName($class)); diff --git a/src/Symfony/Component/Validator/Mapping/ClassMetadata.php b/src/Symfony/Component/Validator/Mapping/ClassMetadata.php index 6e0256c29018..d1ee1212ba29 100644 --- a/src/Symfony/Component/Validator/Mapping/ClassMetadata.php +++ b/src/Symfony/Component/Validator/Mapping/ClassMetadata.php @@ -364,7 +364,7 @@ public function mergeConstraints(self $source) /** * {@inheritdoc} */ - public function hasPropertyMetadata($property) + public function hasPropertyMetadata(string $property) { return \array_key_exists($property, $this->members); } @@ -372,7 +372,7 @@ public function hasPropertyMetadata($property) /** * {@inheritdoc} */ - public function getPropertyMetadata($property) + public function getPropertyMetadata(string $property) { if (!isset($this->members[$property])) { return []; diff --git a/src/Symfony/Component/Validator/Mapping/ClassMetadataInterface.php b/src/Symfony/Component/Validator/Mapping/ClassMetadataInterface.php index 1b6f07ac8eed..b25fc018bb52 100644 --- a/src/Symfony/Component/Validator/Mapping/ClassMetadataInterface.php +++ b/src/Symfony/Component/Validator/Mapping/ClassMetadataInterface.php @@ -81,7 +81,7 @@ public function isGroupSequenceProvider(); * * @return bool */ - public function hasPropertyMetadata($property); + public function hasPropertyMetadata(string $property); /** * Returns all metadata instances for the given named property. @@ -94,7 +94,7 @@ public function hasPropertyMetadata($property); * @return PropertyMetadataInterface[] A list of metadata instances. Empty if * no metadata exists for the property. */ - public function getPropertyMetadata($property); + public function getPropertyMetadata(string $property); /** * Returns the name of the backing PHP class. diff --git a/src/Symfony/Component/Validator/Mapping/GenericMetadata.php b/src/Symfony/Component/Validator/Mapping/GenericMetadata.php index 139d252fc06b..9a2a2d6db7d6 100644 --- a/src/Symfony/Component/Validator/Mapping/GenericMetadata.php +++ b/src/Symfony/Component/Validator/Mapping/GenericMetadata.php @@ -185,7 +185,7 @@ public function hasConstraints() * * Aware of the global group (* group). */ - public function findConstraints($group) + public function findConstraints(string $group) { return isset($this->constraintsByGroup[$group]) ? $this->constraintsByGroup[$group] diff --git a/src/Symfony/Component/Validator/Mapping/MetadataInterface.php b/src/Symfony/Component/Validator/Mapping/MetadataInterface.php index 514beb94926e..f46af2fcce22 100644 --- a/src/Symfony/Component/Validator/Mapping/MetadataInterface.php +++ b/src/Symfony/Component/Validator/Mapping/MetadataInterface.php @@ -62,5 +62,5 @@ public function getConstraints(); * * @return Constraint[] A list of constraint instances */ - public function findConstraints($group); + public function findConstraints(string $group); } diff --git a/src/Symfony/Component/Validator/ObjectInitializerInterface.php b/src/Symfony/Component/Validator/ObjectInitializerInterface.php index 1bd55f0cda8e..8d0688ceced0 100644 --- a/src/Symfony/Component/Validator/ObjectInitializerInterface.php +++ b/src/Symfony/Component/Validator/ObjectInitializerInterface.php @@ -27,5 +27,5 @@ interface ObjectInitializerInterface * * @param object $object The object to validate */ - public function initialize($object); + public function initialize(object $object); } diff --git a/src/Symfony/Component/Validator/Tests/Fixtures/FakeClassMetadata.php b/src/Symfony/Component/Validator/Tests/Fixtures/FakeClassMetadata.php index 39f54777795c..e5e200a5ba41 100644 --- a/src/Symfony/Component/Validator/Tests/Fixtures/FakeClassMetadata.php +++ b/src/Symfony/Component/Validator/Tests/Fixtures/FakeClassMetadata.php @@ -15,7 +15,7 @@ class FakeClassMetadata extends ClassMetadata { - public function addCustomPropertyMetadata($propertyName, $metadata) + public function addCustomPropertyMetadata(string $propertyName, $metadata) { if (!isset($this->members[$propertyName])) { $this->members[$propertyName] = []; diff --git a/src/Symfony/Component/Validator/Validator/ContextualValidatorInterface.php b/src/Symfony/Component/Validator/Validator/ContextualValidatorInterface.php index c8b545b54b4a..68cd36eac98b 100644 --- a/src/Symfony/Component/Validator/Validator/ContextualValidatorInterface.php +++ b/src/Symfony/Component/Validator/Validator/ContextualValidatorInterface.php @@ -32,7 +32,7 @@ interface ContextualValidatorInterface * * @return $this */ - public function atPath($path); + public function atPath(string $path); /** * Validates a value against a constraint or a list of constraints. @@ -58,7 +58,7 @@ public function validate($value, $constraints = null, $groups = null); * * @return $this */ - public function validateProperty($object, $propertyName, $groups = null); + public function validateProperty($object, string $propertyName, $groups = null); /** * Validates a value against the constraints specified for an object's @@ -71,7 +71,7 @@ public function validateProperty($object, $propertyName, $groups = null); * * @return $this */ - public function validatePropertyValue($objectOrClass, $propertyName, $value, $groups = null); + public function validatePropertyValue($objectOrClass, string $propertyName, $value, $groups = null); /** * Returns the violations that have been generated so far in the context diff --git a/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php b/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php index 33e207af473c..cad3acc15464 100644 --- a/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php +++ b/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php @@ -71,7 +71,7 @@ public function __construct(ExecutionContextInterface $context, MetadataFactoryI /** * {@inheritdoc} */ - public function atPath($path) + public function atPath(string $path) { $this->defaultPropertyPath = $this->context->getPropertyPath($path); @@ -169,7 +169,7 @@ public function validate($value, $constraints = null, $groups = null) /** * {@inheritdoc} */ - public function validateProperty($object, $propertyName, $groups = null) + public function validateProperty($object, string $propertyName, $groups = null) { $classMetadata = $this->metadataFactory->getMetadataFor($object); @@ -213,7 +213,7 @@ public function validateProperty($object, $propertyName, $groups = null) /** * {@inheritdoc} */ - public function validatePropertyValue($objectOrClass, $propertyName, $value, $groups = null) + public function validatePropertyValue($objectOrClass, string $propertyName, $value, $groups = null) { $classMetadata = $this->metadataFactory->getMetadataFor($objectOrClass); @@ -295,7 +295,7 @@ protected function normalizeGroups($groups) * traversal, the object will be iterated and each nested object will be * validated instead. * - * @param object $object The object to cascade + * @param object|int|float|string $object The object to cascade * @param string $propertyPath The current property path * @param (string|GroupSequence)[] $groups The validated groups * @param int $traversalStrategy The strategy for traversing the @@ -437,7 +437,7 @@ private function validateEachObjectIn($collection, $propertyPath, array $groups, * * @see TraversalStrategy */ - private function validateClassNode($object, $cacheKey, ClassMetadataInterface $metadata = null, $propertyPath, array $groups, $cascadedGroups, $traversalStrategy, ExecutionContextInterface $context) + private function validateClassNode(object $object, $cacheKey, ClassMetadataInterface $metadata = null, $propertyPath, array $groups, $cascadedGroups, $traversalStrategy, ExecutionContextInterface $context) { $context->setNode($object, $object, $metadata, $propertyPath); @@ -616,7 +616,7 @@ private function validateClassNode($object, $cacheKey, ClassMetadataInterface $m * * @see TraversalStrategy */ - private function validateGenericNode($value, $object, $cacheKey, MetadataInterface $metadata = null, $propertyPath, array $groups, $cascadedGroups, $traversalStrategy, ExecutionContextInterface $context) + private function validateGenericNode($value, ?object $object, $cacheKey, MetadataInterface $metadata = null, $propertyPath, array $groups, $cascadedGroups, $traversalStrategy, ExecutionContextInterface $context) { $context->setNode($value, $object, $metadata, $propertyPath); @@ -724,7 +724,7 @@ private function validateGenericNode($value, $object, $cacheKey, MetadataInterfa * the group sequence * @param ExecutionContextInterface $context The execution context */ - private function stepThroughGroupSequence($value, $object, $cacheKey, MetadataInterface $metadata = null, $propertyPath, $traversalStrategy, GroupSequence $groupSequence, $cascadedGroup, ExecutionContextInterface $context) + private function stepThroughGroupSequence($value, ?object $object, $cacheKey, MetadataInterface $metadata = null, $propertyPath, $traversalStrategy, GroupSequence $groupSequence, $cascadedGroup, ExecutionContextInterface $context) { $violationCount = \count($context->getViolations()); $cascadedGroups = $cascadedGroup ? [$cascadedGroup] : null; diff --git a/src/Symfony/Component/Validator/Validator/RecursiveValidator.php b/src/Symfony/Component/Validator/Validator/RecursiveValidator.php index a258fd4a77d7..8a04e1d1977f 100644 --- a/src/Symfony/Component/Validator/Validator/RecursiveValidator.php +++ b/src/Symfony/Component/Validator/Validator/RecursiveValidator.php @@ -104,7 +104,7 @@ public function validate($value, $constraints = null, $groups = null) /** * {@inheritdoc} */ - public function validateProperty($object, $propertyName, $groups = null) + public function validateProperty($object, string $propertyName, $groups = null) { return $this->startContext($object) ->validateProperty($object, $propertyName, $groups) @@ -114,7 +114,7 @@ public function validateProperty($object, $propertyName, $groups = null) /** * {@inheritdoc} */ - public function validatePropertyValue($objectOrClass, $propertyName, $value, $groups = null) + public function validatePropertyValue($objectOrClass, string $propertyName, $value, $groups = null) { // If a class name is passed, take $value as root return $this->startContext(\is_object($objectOrClass) ? $objectOrClass : $value) diff --git a/src/Symfony/Component/Validator/Validator/TraceableValidator.php b/src/Symfony/Component/Validator/Validator/TraceableValidator.php index c08910d8de92..be7daf48c853 100644 --- a/src/Symfony/Component/Validator/Validator/TraceableValidator.php +++ b/src/Symfony/Component/Validator/Validator/TraceableValidator.php @@ -105,7 +105,7 @@ public function validate($value, $constraints = null, $groups = null) /** * {@inheritdoc} */ - public function validateProperty($object, $propertyName, $groups = null) + public function validateProperty($object, string $propertyName, $groups = null) { return $this->validator->validateProperty($object, $propertyName, $groups); } @@ -113,7 +113,7 @@ public function validateProperty($object, $propertyName, $groups = null) /** * {@inheritdoc} */ - public function validatePropertyValue($objectOrClass, $propertyName, $value, $groups = null) + public function validatePropertyValue($objectOrClass, string $propertyName, $value, $groups = null) { return $this->validator->validatePropertyValue($objectOrClass, $propertyName, $value, $groups); } diff --git a/src/Symfony/Component/Validator/Validator/ValidatorInterface.php b/src/Symfony/Component/Validator/Validator/ValidatorInterface.php index 78157465ab5c..23356638be80 100644 --- a/src/Symfony/Component/Validator/Validator/ValidatorInterface.php +++ b/src/Symfony/Component/Validator/Validator/ValidatorInterface.php @@ -52,7 +52,7 @@ public function validate($value, $constraints = null, $groups = null); * If the list is empty, validation * succeeded */ - public function validateProperty($object, $propertyName, $groups = null); + public function validateProperty($object, string $propertyName, $groups = null); /** * Validates a value against the constraints specified for an object's @@ -67,7 +67,7 @@ public function validateProperty($object, $propertyName, $groups = null); * If the list is empty, validation * succeeded */ - public function validatePropertyValue($objectOrClass, $propertyName, $value, $groups = null); + public function validatePropertyValue($objectOrClass, string $propertyName, $value, $groups = null); /** * Starts a new validation context and returns a validator for that context. diff --git a/src/Symfony/Component/Validator/Violation/ConstraintViolationBuilder.php b/src/Symfony/Component/Validator/Violation/ConstraintViolationBuilder.php index 151a8158158b..229113205012 100644 --- a/src/Symfony/Component/Validator/Violation/ConstraintViolationBuilder.php +++ b/src/Symfony/Component/Validator/Violation/ConstraintViolationBuilder.php @@ -59,7 +59,7 @@ public function __construct(ConstraintViolationList $violations, Constraint $con /** * {@inheritdoc} */ - public function atPath($path) + public function atPath(string $path) { $this->propertyPath = PropertyPath::append($this->propertyPath, $path); @@ -69,7 +69,7 @@ public function atPath($path) /** * {@inheritdoc} */ - public function setParameter($key, $value) + public function setParameter(string $key, string $value) { $this->parameters[$key] = $value; @@ -89,7 +89,7 @@ public function setParameters(array $parameters) /** * {@inheritdoc} */ - public function setTranslationDomain($translationDomain) + public function setTranslationDomain(string $translationDomain) { $this->translationDomain = $translationDomain; @@ -109,7 +109,7 @@ public function setInvalidValue($invalidValue) /** * {@inheritdoc} */ - public function setPlural($number) + public function setPlural(int $number) { $this->plural = $number; @@ -119,7 +119,7 @@ public function setPlural($number) /** * {@inheritdoc} */ - public function setCode($code) + public function setCode(?string $code) { $this->code = $code; diff --git a/src/Symfony/Component/Validator/Violation/ConstraintViolationBuilderInterface.php b/src/Symfony/Component/Validator/Violation/ConstraintViolationBuilderInterface.php index cb007b6e659b..9ac1b8b4c47c 100644 --- a/src/Symfony/Component/Validator/Violation/ConstraintViolationBuilderInterface.php +++ b/src/Symfony/Component/Validator/Violation/ConstraintViolationBuilderInterface.php @@ -33,7 +33,7 @@ interface ConstraintViolationBuilderInterface * * @return $this */ - public function atPath($path); + public function atPath(string $path); /** * Sets a parameter to be inserted into the violation message. @@ -43,7 +43,7 @@ public function atPath($path); * * @return $this */ - public function setParameter($key, $value); + public function setParameter(string $key, string $value); /** * Sets all parameters to be inserted into the violation message. @@ -66,7 +66,7 @@ public function setParameters(array $parameters); * * @see \Symfony\Contracts\Translation\TranslatorInterface */ - public function setTranslationDomain($translationDomain); + public function setTranslationDomain(string $translationDomain); /** * Sets the invalid value that caused this violation. @@ -87,7 +87,7 @@ public function setInvalidValue($invalidValue); * * @see \Symfony\Contracts\Translation\TranslatorInterface::trans() */ - public function setPlural($number); + public function setPlural(int $number); /** * Sets the violation code. @@ -96,7 +96,7 @@ public function setPlural($number); * * @return $this */ - public function setCode($code); + public function setCode(?string $code); /** * Sets the cause of the violation. pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy