This commit adds code to delete corresponding newsletter segment
entities when a given list is deleted. This is necessary to fix an error
when duplicating a newsletter that was sent with a list that was
deleted.
Without this change users see the following SQL error:
```
An exception occurred while executing ‘UPDATE wp_mailpoet_newsletter_segment SET segment_id = ?, updated_at = ? WHERE id = ?’ with params [null, “2023-03-23 09:07:52”, 66]: SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘segment_id’ cannot be null
```
[MAILPOET-5153]
Remove the following errors:
(Method|Property|Function) has no (return )?type specified.
(Method|Function) has parameter with no type (specified).
I have modified bulkDelete to be similar to bulkDelete on SubscribersRepository.php. This function is used in MailPoet\Test\API\JSON\v1\Segments.
[MAILPOET-3720]