php-advanced-json-rpc
php-advanced-json-rpc copied to clipboard
Avoid instantation of class with type mixed during mapping
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.
Could I also get a tag after the merge please? I need this for Psalm v6.
Maybe good to know this repo is kind of dead. The sole maintainer doesn’t seem to be active anymore. Also see https://github.com/felixfbecker/php-advanced-json-rpc/pull/59#issuecomment-1581253698