Skip to content

Utils::validateCallableSignature does not support UnionType #43

@PJZ9n

Description

@PJZ9n

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions