Skip to content

Commit

Permalink
Test - add attributes to ObjectWithEnums' props
Browse files Browse the repository at this point in the history
  • Loading branch information
iksss-invia committed Dec 17, 2024
1 parent b4285f4 commit 603dc10
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 603dc10

Please sign in to comment.