ImportExportRepository::updateMultiple() changes subscribers by running
MySQL queries directly. Now that \MailPoet\Segments\WP uses Doctrine as
well this was causing a bug caught by our integration tests.
```
MailPoet\Subscribers\ImportExport\Import\ImportTest::testItSynchronizesWpUsers
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'mary'
+'Mary'
/wp-core/wp-content/plugins/mailpoet/tests/integration/Subscribers/ImportExport/Import/ImportTest.php:719
```
https://app.circleci.com/pipelines/github/mailpoet/mailpoet/16386/workflows/c3fa0cf4-a77d-41ab-a5cc-78d4b37d9228/jobs/278066/tests#failed-test-0
This test was failing because the Doctrine entities were not updated
after the import process ran and modified the subscribers directly in
the database. Running EntityManager::clear() after importing the
subscribers, forces Doctrine to query the database again to update the
entities and prevents this bug.
[MAILPOET-5752]
Previously there was a mismatch between parameters coming from the
dynamic segment and the parameters coming from the export
controller.
[MAILPOET-5382]
We want to remove/refactor the whole ModelValidator class as part of the
Doctrine refactor.
This commit moves the method ModelValidator::validateNonRoleEmail() to a
new Validator class as the method is not used by the validator system of
the Paris models. ModelValidator::validateEmail() was also moved as it
is called by ModelValidator::validateNonRoleEmail().
[MAILPOET-4343]
We want to remove/refactor the whole ModelValidator class as part of the
Doctrine refactor. As a first step, this commit removes the method
ModelValidator::validateIPAddress(). It was unused in a single place and
it was replaced with a direct call to the builtin PHP way to validate an
IP address.
[MAILPOET-4343]
The test testExportSubscriberWithCustomField was only passing before
because we were truncating tables in between tests, so the custom field
id ended up matching the subscriber custom field id coincidentally.
MAILPOET-5145
MAILPOET-5185
Remove the following errors from Subscribers\ImportExport\Import\MailChimp:
(Method|Property|Function) has no (return )?type specified.
(Method|Function) has parameter with no type (specified).
[MAILPOET-3720]
Remove the following errors from Subscribers\ImportExport\Import\Import:
(Method|Property|Function) has no (return )?type specified.
(Method|Function) has parameter with no type (specified).
I have also added a few checks when using count and typed the arrays when possible.
[MAILPOET-3720]
Remove the following errors:
(Method|Property|Function) has no (return )?type specified.
(Method|Function) has parameter with no type (specified).
array_walk on import.php was expecting the key as the second parameter to the function. I have switched it to array_map.
[MAILPOET-3720]