Skip to content

Commit fe8d68d

Browse files
#260: Replaced annotations with attributes
1 parent 3247a45 commit fe8d68d

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

src/Bsn.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@
2525
use Symfony\Component\Validator\Constraint;
2626

2727
/**
28-
* @Annotation
29-
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
30-
*
3128
* @author Raymond Schouten
3229
*
3330
* @since 2.3
3431
*/
32+
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD)]
3533
class Bsn extends Constraint
3634
{
3735
public string $message = 'This value is not a valid Dutch social security number (BSN).';

src/Collection.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,11 @@
2727
use Symfony\Component\Validator\Exception\ConstraintDefinitionException;
2828

2929
/**
30-
* @Annotation
31-
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
32-
*
3330
* @author Raymond Schouten
3431
*
3532
* @since 2.3
3633
*/
34+
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
3735
class Collection extends Constraint
3836
{
3937
/** @var Constraint[] */

src/Json.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@
2525
use Symfony\Component\Validator\Constraint;
2626

2727
/**
28-
* @Annotation
29-
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
30-
*
3128
* @author Raymond Schouten
3229
*
3330
* @since 2.3
3431
*/
32+
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD)]
3533
class Json extends Constraint
3634
{
3735
public string $message = 'This value is not valid JSON.';

0 commit comments

Comments
 (0)