Given I have the following method:
public function create(array $notificationTypes, NotificationSettings $notificationSettings)
{
}
Is it in any way possible to make sure the $notificationTypes parameter is an array of NotificationType? I tried the following, but it doesn't work:
public function create(array NotificationType $notificationTypes, NotificationSettings $notificationSettings)
{
}
public function create(NotificationType[] $notificationTypes, NotificationSettings $notificationSettings)
{
}
If this isn't possible, is there no other way than looping through $notificationTypes and check if each element is an instance of NotificationType?
Thanks for reading!