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

Avoid instantation of class with type mixed during mapping #60

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

danog
Copy link

@danog danog commented Aug 25, 2023

Some PHP 8+ coding standards require the specification of a typehint in all parameters of all functions, even if it's just a mixed typehint.
Unfortunately, the library treats mixed typehints as a concrete class type, trying to automatically map passed objects.
This is undesirable for methods like LSP's executeCommand, which takes an LSPAny = LSPObject | LSPArray | string | integer | uinteger | decimal | boolean | null arg, essentially equivalent to a mixed type.

This library already supports skipping by not providing a typehint: this PR allow skipping mapping by also providing a mixed typehint.

@danog
Copy link
Author

danog commented Aug 25, 2023

Could I also get a tag after the merge please?
I need this for Psalm v6.

@DannyvdSluijs
Copy link
Contributor

Maybe good to know this repo is kind of dead. The sole maintainer doesn’t seem to be active anymore. Also see #59 (comment)

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

Successfully merging this pull request may close these issues.

2 participants