Open davidmohamedfr opened 1 week ago
@davidmohamedfr please share some code examples so I can reproduce
This is an example.
I'm in PHP 8.3.2, using Laravel Framework 11.2.0 and Scramble 0.10.13
enum MyEnum: int
{
case TITI = 1;
case TOTO = 2;
public function label(): string
{
return match ($this) {
Origin::TITI => 'titi',
Origin::TOTO => 'toto',
};
}
}
enum CarsEnum: int
{
case TOYOTA= 1;
case FERRARI = 2;
}
/**
* @param array<string, mixed> $data
*/
public static function create(array $data)
{
return new DTO(
titi: MyEnum::from($data['titi']),
cars: CarsEnum::from($data['cars']),
);
}
@davidmohamedfr I still don't understand how your controller looks like for the api route that fails
@davidmohamedfr Please share the code that I can use to reproduce. This includes everything that is needed to have the same issue
Hi ! I'm having a "Path cannot be empty" error on docs generation because i'm using native Enum class from PHP
From what I've investigate, trouble come from
MethodReflector:getReflection
usingnew ReflectionMethod
when reflection for Enum need to be used withnew ReflectionEnum
Hope this will help someone fix this issue.