[BUG] Multiple types set dynamically
ste101 opened this issue · 2 comments
ste101 commented
Setting multiple types like this works:
TypeFactory::createType('Product', 'Service');
But if I want to set them dynamically through a variable I'm getting errors:
e.g:
$types = "'Product', 'Service'";
TypeFactory::createType($types);
I tried every writing, also arrays don't work.
brotkrueml commented
Use argument unpacking:
$types = ['Product', 'Service'];
TypeFactory::createType(...$types);
See: https://www.php.net/manual/en/migration56.new-features.php#migration56.new-features.splat
ste101 commented
Thank you for your help