Skip to content

Commit 5ed7925

Browse files
IssamRaoufnicolas-grekas
authored andcommitted
[FrameworkBundle][Validator] Replace annotation by attribute
1 parent 7583c35 commit 5ed7925

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

Tests/Constraints/Fixtures/ChildA.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,14 @@
1515

1616
class ChildA
1717
{
18-
/**
19-
* @Assert\Valid
20-
* @Assert\NotNull
21-
* @Assert\NotBlank
22-
*/
18+
#[Assert\Valid]
19+
#[Assert\NotNull]
20+
#[Assert\NotBlank]
2321
public $name;
2422
/**
2523
* @var ChildB
26-
* @Assert\Valid
27-
* @Assert\NotNull
2824
*/
25+
#[Assert\Valid]
26+
#[Assert\NotNull]
2927
public $childB;
3028
}

Tests/Constraints/Fixtures/ChildB.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,13 @@
1515

1616
class ChildB
1717
{
18-
/**
19-
* @Assert\Valid
20-
* @Assert\NotBlank
21-
*/
18+
#[Assert\Valid]
19+
#[Assert\NotBlank]
2220
public $name;
2321
/**
2422
* @var ChildA
25-
* @Assert\Valid
26-
* @Assert\NotBlank
2723
*/
24+
#[Assert\Valid]
25+
#[Assert\NotBlank]
2826
public $childA;
2927
}

0 commit comments

Comments
 (0)