Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

"New in initializers" breaks in docblock

Aperta
#173 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
42/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
php
Ambito
devtools

Direzione di ricerca

Start with the linked PHPStan reproducer and trace how the parser handles the @method docblock syntax involving PHP 8.1 "new in initializers." Compare it with the equivalent syntax accepted in code. Done means the docblock case parses correctly and has regression coverage for the reported example.

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

Descrizione

Bug report

Since PHP 8.1, it is possible to use new as default parameters ("new in initializers" RFC).

PHPStan gets it perfectly, but things stop working once we move them to docblocks, explicitly the @method docblock (see example).

Code snippet that reproduces the problem

https://phpstan.org/r/5d0cdcbb-5c11-4483-90b0-b95986f92bc2

Expected output

Since PHPStan understands the "new in initializers" in the code, I guess that this is a missed use-case instead of an actual bug, but I didn't know where to report it.

Did PHPStan help you today? Did it make you happy in any way?

Every. single. day.

Thanks for this amazing tool!

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.