Skip to content

ksort(): Argument #1 ($array) must be of type array, ArrayObject given #4089

Description

@binita

https://github.com/api-platform/core/blob/v2.6.2/src/OpenApi/Serializer/OpenApiNormalizer.php#L59
I have setup php 8.0.0 with symfony 5.2.3 and after doing composer require api when I access the localhost/api
I got error ksort(): Argument #1 ($array) must be of type array, ArrayObject given

I replaced that line 59 with

if (is_array($value)) {
      ksort($value);
}

if ($value instanceof \ArrayObject) {
     $value->ksort();
}

Now it is working.

Could someone, please look into this and fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions