Skip to content

Commit

Permalink
Merge pull request #1581 from iKsSs/enum-test-attribute
Browse files Browse the repository at this point in the history
Test - add attributes to ObjectWithEnums' props
  • Loading branch information
scyzoryck authored Jan 3, 2025
2 parents f974e58 + 603dc10 commit fa7ab39
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/Fixtures/ObjectWithEnums.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,39 @@ class ObjectWithEnums
/**
* @Serializer\Type("enum<JMS\Serializer\Tests\Fixtures\Enum\Suit, 'name'>")
*/
#[Serializer\Type(name: 'enum<' . Suit::class . ", 'name'>")]
public Suit $ordinary;

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

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

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

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

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

public Suit $ordinaryAutoDetect;
Expand Down

0 comments on commit fa7ab39

Please sign in to comment.