In client code we expect that botch category and product ids
are strings but we send strings for lists based on posts and integers
for lists based on terms. We use mostly string values so this change unifies
that all ids for autocomplete lists are strings.
[MAILPOET-3555]
This commit fixes the following PHPStan errors introduced after the update to version 0.12.83:
```
------ ----------------------------------------------------------------------
Line lib/Newsletter/Renderer/Blocks/Footer.php
------ ----------------------------------------------------------------------
18 Parameter #1 $html of method MailPoet\Util\pQuery\pQuery::parseStr()
expects string, array|string|null given.
------ ----------------------------------------------------------------------
------ ----------------------------------------------------------------------
Line lib/Newsletter/Renderer/Blocks/Header.php
------ ----------------------------------------------------------------------
18 Parameter #1 $html of method MailPoet\Util\pQuery\pQuery::parseStr()
expects string, array|string|null given.
------ ----------------------------------------------------------------------
```
[MAILPOET-3491]
This commit ignores the following PHPStan error introduced after the update to version 0.12.83. It seems the error is caused by a problem in Carbon's documentation so there is not way for us to fix it for now. Carbon's constructor accepts an instance of DateTimeInterface, but its phpdoc block only mentions string or null.
```
------ ----------------------------------------------------------------------
Line lib/Entities/NewsletterEntity.php
------ ----------------------------------------------------------------------
283 Parameter #1 $time of class MailPoetVendor\Carbon\Carbon constructor
expects string|null, DateTimeInterface|null given.
------ ----------------------------------------------------------------------
```
[MAILPOET-3491]
This commit fixes the following PHPStan errors introduced after the
update to version 0.12.83:
```
------ ----------------------------------------------------------------------
Line lib/Listing/Handler.php
------ ----------------------------------------------------------------------
18 Parameter #1 $callback of function call_user_func_array expects
callable(): mixed, array(class-string|object, 'listingQuery') given.
45 Parameter #1 $callback of function call_user_func_array expects
callable(): mixed, array(class-string|object, 'groups') given.
54 Parameter #1 $callback of function call_user_func_array expects
callable(): mixed, array(class-string|object, 'filters') given.
62 Parameter #1 $callback of function call_user_func_array expects
callable(): mixed, array(class-string|object, 'listingQuery') given.
------ ----------------------------------------------------------------------
```
It was necessary to use both is_callable() and method_exists() instead
of just is_callable(), as a parent class of the model classes implements
__call() and thus is_callable() always returns true even when the
method doesn't exist (and in those cases method_exists() returns false).
[MAILPOET-3491]
This commit replaces the usage of Paris with Doctrine inside
MailPoet\API\JSON\v1\Forms::listing(). It also introduces a new class
MailPoet\Form\Listing\FormListingRepository that is used by listing() to
prepare the query that is executed by Doctrine and a new
MailPoet\API\JSON\ResponseBuilders\FormsResponseBuilder::buildForListing()
method to prepare the response that is returned by listing(). A few tests were
adjusted and new tests were added for the new class.
[MAILPOET-3036]