When defining property casts using ref() causes an infinite loop.
/**
* @property string $my_property_name
*/
class Flim extends DataTransferObject
{
public static function casts(): array
{
return [
// ref() tries to load the class property data with includes a call to this method to
// get the casts and loops infinitely.
self::ref()->my_property_name => new MyPropertyCast(),
];
}
}
For now just use a string literal.
/**
* @property string $my_property_name
*/
class Flim extends DataTransferObject
{
public static function casts(): array
{
return [
// this is safe
'my_property_name' => new MyPropertyCast(),
];
}
}
When defining property casts using
ref()causes an infinite loop.For now just use a string literal.