dedoc / scramble

Modern Laravel OpenAPI (Swagger) documentation generator. No PHPDoc annotations required.
https://scramble.dedoc.co/
MIT License
1.18k stars 112 forks source link

Dynamic Static Calls cause Internal Server Error #557

Open rahulmkhj opened 3 days ago

rahulmkhj commented 3 days ago

The problem

The /api/docs page is not rendered with error: Error when analysing route {url}: Call to undefined method PhpParser\Node\Expr\Variable::toString() // vendor/dedoc/scramble/src/Generator.php:67

How to reproduce

//create an enum
enum Vendor
{
    case V1;
    case V2;
}

//try to get the enum cases dynamically in any of the controller methods.
$v = 'V1';

//PHP 8.3
$vendor = Vendor::{$v};

//earlier PHP versions with enum support.
$vendor = constant("Vendor::{$v}");