Anonymous classes not recognized
FernandoIberian opened this issue · comments
FernandoIberian commented
Since ~1.7.0 the following code does not work:
<?php
require 'vendor/autoload.php';
interface ValinorDTO {}
$stub = new class implements ValinorDTO {
public string $foo;
}
return (new \CuyZ\Valinor\MapperBuilder())
->mapper()
->map(
$stub::class,
['foo' => 'bar']
);
Exception: CuyZ\Valinor\Type\Parser\Exception\UnknownSymbol: Cannot parse unknown symbol ValinorDTO@anonymous/absolute_path/file.php.
.
This is only used for testing purposes, i don't really know if parsing annonymous classes should be in the scope of this library, but if it is, i'm happy to help! Thank you :)
Romain Canon commented
Should have been fixed by #504!