Files
piratepoet/lib/Listing
Rodrigo Primo 3d31f1f030 Fix PHPStan callback error introduced after update to version 0.12.83
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]
2021-04-12 08:55:14 +02:00
..