WordPress / WordPress/phpdoc-parser
Compatibility updates required
Nessuno ha ancora preso questa issue.
- Lingua principale
- PHP
- Stelle
- 239
- Fork
- 81
- Merge medio
- 16h 29m
- PR unite (30g)
- 8
Descrizione
This package / library / plugin is severely outdated, and no longer operates correctly on PHP 8.1.
I believe this library needs a fundamental rewrite.
Unfortunately the main dependency of it, "phpdocumentor/reflection" : "~3.0", (PHP 5.3.3+) has made several rewrites of the library in v4, v5, and v6. https://github.com/phpDocumentor/Reflection/releases
Additionally, v5.2 supported PHP >=7.2 (PHP8 support unknown), but v5.3 requires PHP 7.4/8.x, and v6 is PHP 8.1+ only.
I have previously gone done this path, and there's some changes here, but I have no recollection of the status or whether it worked / etc. https://github.com/WordPress/phpdoc-parser/compare/master...dd32:phpdoc-parser:try/upgrade-phpdocumentor
If you incorrectly run the parser on the develop.svn checkout without specifying the src/ folder as the base to parse, it'll run into this error on PHP 7.4 + WP 6.5+, which I'm assuming is newer PHP syntax that the parser doesn't understand in the tests/ folder.
[28-Apr-2025 03:14:29 UTC] PHP Fatal error: Uncaught Error: Object of class PhpParser\Node\Stmt\Class_ could not be converted to string in /var/www/html/wp-content/plugins/phpdoc-parser/vendor/phpdocumentor/reflection/src/phpDocumentor/Reflection/BaseReflector.php:172
But even without tests/ included, parsing will often throw errors like Parse Error: Syntax error, unexpected '?', expecting T_VARIABLE on line 62 Parse Error: Syntax error, unexpected '?', expecting T_VARIABLE on line 127 and I have no idea what impact that is having :)
ref https://meta.trac.wordpress.org/ticket/7963 https://meta.trac.wordpress.org/ticket/7964
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia esaminando il tentativo di aggiornamento esistente e riproducendo i fallimenti del parser su PHP 7.4 e 8.1, confrontando il comportamento con e senza il percorso di base src/. Ispeziona vendor/phpdocumentor/reflection/src/phpDocumentor/Reflection/BaseReflector.php e la gestione di tests/ da parte del parser. Il lavoro è completato quando il parser funziona con la dipendenza supportata dell’epoca di PHP 8.1 e non segnala più gli errori di sintassi o di conversione degli oggetti descritti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- php
- Ambito
- documentation, tooling
- Tipo di issue
- Bug
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Tranquilla
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 35/100