support for class-string-map<T of Foo>

Aperta
#281 2 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
php
Ambito
devtools

Direzione di ricerca

Start by reviewing issue #246, PHPStan issue #9521, and the linked phpDocumentor TypeResolver issue to understand the proposed class-string-map syntax. Then examine how GenericType represents bounds and how the parser handles this syntax; done means an agreed representation and parser support that avoids a crash.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

I was investigating the option to add support for class-string-map<T of Foo> and found #246, and also https://github.com/phpstan/phpstan/issues/9521. According to @ondrejmirtes in #246 this syntax should already be supported by this library. But is it not.

I'm wondering if we should introduce the syntax, and how this would look like. I can help with the implementation in the parser. But not without an agreement on how this would work on the GenericType.

I would suggest to add a $bound type on the GenericType which is equal to the behavior on @template

This is needed to the mentioned change in phpstan and https://github.com/phpDocumentor/TypeResolver/issues/266. Support in the parser would at least prevent a crash in the parser.

Thanks for this library! 🎉

Lingua principale
PHP
Stelle
1.5k
Fork
78
Merge medio
9h 5m
PR unite (30g)
5

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di phpstan/phpdoc-parser

Tutte le issue di phpstan/phpdoc-parser

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.