Skip to content

[Server] Handler type uses bare Closure, hard to decorate RegistryInterface under strict PHPStan #468

Description

@shahinataei-ts

The Handler phpstan-type on ElementReference uses a bare \Closure. Implementing RegistryInterface with checkMissingCallableSignature enabled is then impossible: bare Closure fails the signature rule, and adding one breaks contravariance against the interface. \Closure(mixed...): mixed on the alias fixes both. Happy to send the one-liner.

Activity

  1. chr-hertel commented on Aug 22, 2026

    @chr-hertel
    Member

    Sure, PR welcome :)

  2. changed the title [-]Handler type uses bare Closure, hard to decorate RegistryInterface under strict PHPStan[/-] [+][Server] Handler type uses bare Closure, hard to decorate RegistryInterface under strict PHPStan[/+] on Aug 22, 2026
  3. added
    ServerIssues & PRs related to the Server component
    on Aug 22, 2026
  4. chr-hertel commented on Aug 24, 2026

    @chr-hertel
    Member

    can you share your implementation and the error you're getting here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ServerIssues & PRs related to the Server component

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions