I want to call a method like that:
public function to(Address|string ...$addresses) {}
I can call it with $obj->to("my-address")
. But, when I want to give a list of address, I'm using:
$myList = [ "address-1", "address-2" ];
$obj->to($myList);
But I get this error: must be of type Symfony\Component\Mime\Address|string, array given
Even if it's with []
:
How can I use array as parameters?