Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support writeable object shape #569

Open
momala454 opened this issue Oct 24, 2024 · 1 comment
Open

Support writeable object shape #569

momala454 opened this issue Oct 24, 2024 · 1 comment

Comments

@momala454
Copy link

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),
    );
@momala454
Copy link
Author

sorry I forgot you don't support object (#564 (reply in thread))
Is there any possibility to support objects ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant