mirror of
https://github.com/danog/Valinor.git
synced 2024-11-26 20:24:40 +01:00
69ebd19ee8
This notation can be used when several cases in an enum share a common prefix. ```php enum SomeEnum: string { case FOO = 'foo'; case BAR = 'bar'; case BAZ = 'baz'; } $mapper = (new MapperBuilder())->mapper(); $mapper->map('SomeEnum::BA*', 'foo'); // error $mapper->map('SomeEnum::BA*', 'bar'); // ok $mapper->map('SomeEnum::BA*', 'baz'); // ok ```
13 lines
177 B
PHP
13 lines
177 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace CuyZ\Valinor\Tests\Fixture\Enum;
|
|
|
|
enum BackedStringEnum: string
|
|
{
|
|
case FOO = 'foo';
|
|
case BAR = 'bar';
|
|
case BAZ = 'baz';
|
|
}
|