Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Cannot access an offset on array<int, string>|int. #7893

@jordisala1991

Description

@jordisala1991

Bug report

Since 1.8.3 we are getting an error when trying to access array both with [] and adding items on nested property ['_labels'][].

The code is located here: https://github.com/sonata-project/SonataAdminBundle/blob/4.x/src/Form/DataTransformer/ModelToIdPropertyTransformer.php#L194-L195

Code snippet that reproduces the problem

https://phpstan.org/r/6a9d7024-7818-4de5-b224-961eebcda927

Expected output

No errors

Did PHPStan help you today? Did it make you happy in any way?

PHPStan helps me everyday :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    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