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

Offen
#281 2 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
25/100
Issue-Typ
Feature
Klarheit
Muss geklärt werden
Aktivitätsstatus
Veraltet
Tech-Stack
php
Bereich
devtools

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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! 🎉

Vorherrschende Sprache
PHP
Sterne
1.5k
Forks
78
Ø Merge
9 Std. 5 Min.
Gemergte PRs (30 T.)
5

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus phpstan/phpdoc-parser

Alle Issues in phpstan/phpdoc-parser

Ähnliche Issues

Weitere Issues zu PHP

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.