Skip to content

Commit fa7ab39

Browse files
authored
Merge pull request #1581 from iKsSs/enum-test-attribute
Test - add attributes to ObjectWithEnums' props
2 parents f974e58 + 603dc10 commit fa7ab39

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/Fixtures/ObjectWithEnums.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,39 @@ class ObjectWithEnums
1414
/**
1515
* @Serializer\Type("enum<JMS\Serializer\Tests\Fixtures\Enum\Suit, 'name'>")
1616
*/
17+
#[Serializer\Type(name: 'enum<' . Suit::class . ", 'name'>")]
1718
public Suit $ordinary;
1819

1920
/**
2021
* @Serializer\Type("enum<JMS\Serializer\Tests\Fixtures\Enum\BackedSuit, 'value'>")
2122
*/
23+
#[Serializer\Type(name: 'enum<' . BackedSuit::class . ", 'value'>")]
2224
public BackedSuit $backedValue;
2325

2426
/**
2527
* Deprecated, remove single quote around type with 4.0.
2628
*
2729
* @Serializer\Type("enum<'JMS\Serializer\Tests\Fixtures\Enum\BackedSuit'>")
2830
*/
31+
#[Serializer\Type(name: "enum<'" . BackedSuit::class . "'>")]
2932
public BackedSuit $backedWithoutParam;
3033

3134
/**
3235
* @Serializer\Type("array<enum<JMS\Serializer\Tests\Fixtures\Enum\Suit>>")
3336
*/
37+
#[Serializer\Type(name: 'array<enum<' . Suit::class . '>>')]
3438
public array $ordinaryArray;
3539

3640
/**
3741
* @Serializer\Type("array<enum<JMS\Serializer\Tests\Fixtures\Enum\BackedSuit, 'value'>>")
3842
*/
43+
#[Serializer\Type(name: 'array<enum<' . BackedSuit::class . ", 'value'>>")]
3944
public array $backedArray;
4045

4146
/**
4247
* @Serializer\Type("array<enum<JMS\Serializer\Tests\Fixtures\Enum\BackedSuit>>")
4348
*/
49+
#[Serializer\Type(name: 'array<enum<' . BackedSuit::class . '>>')]
4450
public array $backedArrayWithoutParam;
4551

4652
public Suit $ordinaryAutoDetect;

0 commit comments

Comments
 (0)