8000 [FrameworkBundle][Validator] Replace annotation by attribute · symfony/symfony@65e21f9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 65e21f9

Browse files
IssamRaoufnicolas-grekas
authored andcommitted
[FrameworkBundle][Validator] Replace annotation by attribute
1 parent bb8c76d commit 65e21f9

File tree

3 files changed

+10
-16
lines changed

3 files changed

+10
-16
lines changed

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Validation/SubCategory.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
class SubCategory extends Category
88
{
9-
/**
10-
* @Assert\Type("string")
11-
*/
9+
#[Assert\Type("string")]
1210
public $main;
1311
}

src/Symfony/Component/Validator/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
}

src/Symfony/Component/Validator/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)
0