GatoGraphQL / GatoGraphQL

Interact with all your data in WordPress using GraphQL

Home Page:https://gatographql.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Downgrade] Reinstate `mixed` type and union types in anonymous functions

leoloso opened this issue · comments

The mixed type is being downgraded for PHP 7.1, however currently the rule does not work with anonymous functions.

Then, this code is not being downgraded:

if ($failedCastingFieldArgs = \array_filter($castedFieldArgs, function (mixed $fieldArgValue) {
  return \is_null($fieldArgValue);
})) {

It has been temporarily commented out. Re-enable once Rector can downgrade this code.

Also implement for union types (rectorphp/rector#5989 was closed in Rector repo):

$ids = array_map(
-    function (int | string $id) {
+    function ($id) {
        return 'v' . $id;
    },
    $ids
);

To reinstate commented code, search for:

// @see https://github.com/leoloso/PoP/issues/626