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

Utils::validateCallableSignature does not support UnionType #43

Open
PJZ9n opened this issue Oct 12, 2021 · 0 comments
Open

Utils::validateCallableSignature does not support UnionType #43

PJZ9n opened this issue Oct 12, 2021 · 0 comments

Comments

@PJZ9n
Copy link

PJZ9n commented Oct 12, 2021

Issue description

  • Expected result: Can successfully verify callables including UnionType
  • Actual result: Get an error

This is actually a problem with the pmmp/CallbackValidator library, but I think PMs that provide APIs that use these support PHP8 and need to be able to use it.

Steps to reproduce the issue

  1. pocketmine\utils\Utils::validateCallableSignature(function (string|int $a): void {}, function (): void {});
  2. Throw exceptions

OS and versions

Server version: 4.0.0-BETA4 (git hash: 9e6d7405709560c0025e072324602983213276dd)
Compatible Minecraft version: 1.17.30 (protocol version: 465)
PHP version: 8.0.11
PHP JIT: disabled
Operating system: win

Plugins

  • If you remove all plugins, does the issue still occur? Yes
  • If the issue is not reproducible without plugins: No
    • Have you asked for help on our forums before creating an issue?
    • Can you provide sample, minimal reproducing code for the issue? If so, paste it in the bottom section

Crashdump, backtrace or other files

LogicException: "Unsupported reflection type ReflectionUnionType" (EXCEPTION) in "pmsrc/vendor/pocketmine/callback-validator/src/ParameterType" at line 82
@dktapps dktapps transferred this issue from pmmp/PocketMine-MP Oct 12, 2021
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