Skip to content

Commit cbb9d01

Browse files
minor #36057 [Validator] clarify stringable type annotations (nicolas-grekas)
This PR was merged into the 3.4 branch. Discussion ---------- [Validator] clarify stringable type annotations | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Commits ------- 0ee97f2 [Validator] clarify stringable type annotations
2 parents f6f19e6 + 0ee97f2 commit cbb9d01

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

src/Symfony/Component/Validator/ConstraintViolation.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,22 @@ class ConstraintViolation implements ConstraintViolationInterface
3232
/**
3333
* Creates a new constraint violation.
3434
*
35-
* @param string $message The violation message
36-
* @param string $messageTemplate The raw violation message
37-
* @param array $parameters The parameters to substitute in the
38-
* raw violation message
39-
* @param mixed $root The value originally passed to the
40-
* validator
41-
* @param string $propertyPath The property path from the root
42-
* value to the invalid value
43-
* @param mixed $invalidValue The invalid value that caused this
44-
* violation
45-
* @param int|null $plural The number for determining the plural
46-
* form when translating the message
47-
* @param mixed $code The error code of the violation
48-
* @param Constraint|null $constraint The constraint whose validation
49-
* caused the violation
50-
* @param mixed $cause The cause of the violation
35+
* @param string|\Stringable $message The violation message as a string or a stringable object
36+
* @param string $messageTemplate The raw violation message
37+
* @param array $parameters The parameters to substitute in the
38+
* raw violation message
39+
* @param mixed $root The value originally passed to the
40+
* validator
41+
* @param string $propertyPath The property path from the root
42+
* value to the invalid value
43+
* @param mixed $invalidValue The invalid value that caused this
44+
* violation
45+
* @param int|null $plural The number for determining the plural
46+
* form when translating the message
47+
* @param mixed $code The error code of the violation
48+
* @param Constraint|null $constraint The constraint whose validation
49+
* caused the violation
50+
* @param mixed $cause The cause of the violation
5151
*/
5252
public function __construct($message, $messageTemplate, array $parameters, $root, $propertyPath, $invalidValue, $plural = null, $code = null, Constraint $constraint = null, $cause = null)
5353
{

src/Symfony/Component/Validator/ConstraintViolationInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ interface ConstraintViolationInterface
3636
/**
3737
* Returns the violation message.
3838
*
39-
* @return string The violation message
39+
* @return string|\Stringable The violation message as a string or a stringable object
4040
*/
4141
public function getMessage();
4242

src/Symfony/Component/Validator/Context/ExecutionContextInterface.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ interface ExecutionContextInterface
6464
/**
6565
* Adds a violation at the current node of the validation graph.
6666
*
67-
* @param string $message The error message
68-
* @param array $params The parameters substituted in the error message
67+
* @param string|\Stringable $message The error message as a string or a stringable object
68+
* @param array $params The parameters substituted in the error message
6969
*/
7070
public function addViolation($message, array $params = []);
7171

@@ -81,8 +81,8 @@ public function addViolation($message, array $params = []);
8181
* ->setTranslationDomain('number_validation')
8282
* ->addViolation();
8383
*
84-
* @param string $message The error message
85-
* @param array $parameters The parameters substituted in the error message
84+
* @param string|\Stringable $message The error message as a string or a stringable object
85+
* @param array $parameters The parameters substituted in the error message
8686
*
8787
* @return ConstraintViolationBuilderInterface The violation builder
8888
*/

0 commit comments

Comments
 (0)
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