Composer constrainer is not able to handle class_alias()

julian.kreller
julian.kreller Spryker Solution Partner, Spryker Technology Partner Posts: 2 🧑🏻‍🚀 - Cadet
edited August 2023 in Spryker Development

I got a quite specific use case within my code, where I create an anonymous class extending another class dynamically.

Our pipelines fail since Spryker's composer-constrainer cannot handle this.

class_alias($class, '\AnyClass'); // value of $class is only known at runtime

$extendedClass = new class () extends \AnyClass {…}

Does anyone has an idea how to make this work? Otherwise the support of class_alias() should be added!

Tagged:

Comments