-
-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #416 [Live] Support (de)hydrating nullable backed Enum's (kbond)
This PR was merged into the 2.x branch. Discussion ---------- [Live] Support (de)hydrating nullable backed Enum's | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | Tickets | Fix #414 | License | MIT Commits ------- bfd7f8d [Live] support (de)hydrating Enum's
- Loading branch information
Showing
7 changed files
with
128 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Symfony\UX\LiveComponent\Tests\Fixtures\Component; | ||
|
||
use Symfony\UX\LiveComponent\Attribute\AsLiveComponent; | ||
use Symfony\UX\LiveComponent\Attribute\LiveProp; | ||
use Symfony\UX\LiveComponent\DefaultActionTrait; | ||
use Symfony\UX\LiveComponent\Tests\Fixtures\Enum\EmptyStringEnum; | ||
use Symfony\UX\LiveComponent\Tests\Fixtures\Enum\IntEnum; | ||
use Symfony\UX\LiveComponent\Tests\Fixtures\Enum\StringEnum; | ||
use Symfony\UX\LiveComponent\Tests\Fixtures\Enum\ZeroIntEnum; | ||
|
||
#[AsLiveComponent('with_enum')] | ||
final class WithEnums | ||
{ | ||
use DefaultActionTrait; | ||
|
||
#[LiveProp(writable: true)] | ||
public ?IntEnum $int = null; | ||
|
||
#[LiveProp(writable: true)] | ||
public ?StringEnum $string = null; | ||
|
||
#[LiveProp(writable: true)] | ||
public ?ZeroIntEnum $zeroInt = null; | ||
|
||
#[LiveProp(writable: true)] | ||
public ?EmptyStringEnum $emptyString = null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace Symfony\UX\LiveComponent\Tests\Fixtures\Enum; | ||
|
||
enum EmptyStringEnum: string | ||
{ | ||
case EMPTY = ''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
namespace Symfony\UX\LiveComponent\Tests\Fixtures\Enum; | ||
|
||
enum IntEnum: int | ||
{ | ||
case HIGH = 10; | ||
case LOW = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
namespace Symfony\UX\LiveComponent\Tests\Fixtures\Enum; | ||
|
||
enum StringEnum: string | ||
{ | ||
case PENDING = 'pending'; | ||
case ACTIVE = 'active'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
namespace Symfony\UX\LiveComponent\Tests\Fixtures\Enum; | ||
|
||
enum ZeroIntEnum: int | ||
{ | ||
case ZERO = 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters