-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor #175 Throw bad method call on attempt to call ReadableEnumtrait…
…::readableForValue on non backed enum (ogizanagi) This PR was merged into the 2.x-dev branch. Discussion ---------- Throw bad method call on attempt to call ReadableEnumtrait::readableForValue on non backed enum Commits ------- b7b8ead Throw bad method call on attempt to call ReadableEnumtrait::readableForValue on non backed enum
- Loading branch information
Showing
5 changed files
with
55 additions
and
4 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
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,34 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the "elao/enum" package. | ||
* | ||
* Copyright (C) Elao | ||
* | ||
* @author Elao <[email protected]> | ||
*/ | ||
|
||
namespace Elao\Enum\Tests\Fixtures\Enum; | ||
|
||
use Elao\Enum\ReadableEnumInterface; | ||
use Elao\Enum\ReadableEnumTrait; | ||
|
||
enum UnitSuit implements ReadableEnumInterface | ||
{ | ||
use ReadableEnumTrait; | ||
|
||
case Hearts; | ||
case Diamonds; | ||
case Clubs; | ||
case Spades; | ||
|
||
public static function readables(): iterable | ||
{ | ||
yield self::Hearts => 'suit.hearts'; | ||
yield self::Diamonds => 'suit.diamonds'; | ||
yield self::Clubs => 'suit.clubs'; | ||
yield self::Spades => 'suit.spades'; | ||
} | ||
} |
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