Skip to content

Commit e402f9f

Browse files
author
symfonyaml
committed
[Validator] Fix type declaration validate + remove old annotations
1 parent c9050da commit e402f9f

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

src/Symfony/Component/Validator/Constraints/Yaml.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@
1414
use Symfony\Component\Validator\Constraint;
1515
use Symfony\Component\Validator\Exception\InvalidArgumentException;
1616

17-
/**
18-
* @Annotation
19-
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
20-
*
21-
* @author symfonyaml
22-
*/
2317
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
2418
class Yaml extends Constraint
2519
{
@@ -29,11 +23,6 @@ class Yaml extends Constraint
2923
self::INVALID_YAML_ERROR => 'INVALID_YAML_ERROR',
3024
];
3125

32-
/**
33-
* @deprecated since Symfony 6.1, use const ERROR_NAMES instead
34-
*/
35-
protected static $errorNames = self::ERROR_NAMES;
36-
3726
public $message = 'This value should be valid YAML.';
3827
public $flags = 0;
3928

src/Symfony/Component/Validator/Constraints/YamlValidator.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@
2323
*/
2424
class YamlValidator extends ConstraintValidator
2525
{
26-
/**
27-
* @return void
28-
*/
29-
public function validate(mixed $value, Constraint $constraint)
26+
public function validate(mixed $value, Constraint $constraint): void
3027
{
3128
if (!$constraint instanceof Yaml) {
3229
throw new UnexpectedTypeException($constraint, Yaml::class);

0 commit comments

Comments
 (0)