[Server] Handler type uses bare Closure, hard to decorate RegistryInterface under strict PHPStan
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 78/100
Research direction
Find the Handler phpstan-type alias on ElementReference and inspect how it is used by RegistryInterface. Change the bare Closure type to the compatible signature described in the issue, then run the project's PHPStan checks to confirm checkMissingCallableSignature passes without a contravariance error.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- PHP
- Stars
- 1.6k
- Forks
- 173
- Avg merge
- 2d 49m
- Merged PRs (30d)
- 23
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from modelcontextprotocol/php-sdk
-
needs confirmation needs maintainer action Server
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
modelcontextprotocol/php-sdk#398 · 1 reaction ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
modelcontextprotocol/php-sdk#370 ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 55/100
modelcontextprotocol/php-sdk#510 · 1 comment ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 45/100
modelcontextprotocol/php-sdk#504 ·
-
bug P2 Server
Difficulty 4/5 3-5 days Newbie friendliness 68/100
modelcontextprotocol/php-sdk#498 · 2 comments ·
All issues in modelcontextprotocol/php-sdk
Similar issues
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
0. Needs triage bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nextcloud/fulltextsearch#1011 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
phpstan/phpstan-doctrine#794 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Automattic/static-site-importer#1767 ·