Skip to content

Support writeable object shape #569

Open
@momala454

Description

Apparently, to be able to make properties writeable, you must combine the object shape with stdclass (ref : phpstan/phpstan#10079)
However, it is not supported

Could not parse the type `\stdClass&object{info: string}` that should be mapped: Invalid intersection member `object`, it must be a class name or an interface name
(new \CuyZ\Valinor\MapperBuilder())
    ->allowSuperfluousKeys()
    ->allowPermissiveTypes()
    ->mapper()
    ->map(
        '\stdClass&object{info: string}',
        \CuyZ\Valinor\Mapper\Source\Source::json($string),
    );

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions