WordPress / WordPress/phpdoc-parser
Compatibility updates required
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- PHP
- Sterne
- 239
- Forks
- 81
- Ø Merge
- 16 Std. 29 Min.
- Gemergte PRs (30 T.)
- 8
Beschreibung
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
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, den bestehenden Upgrade-Versuch zu überprüfen und die Parserfehler unter PHP 7.4 und 8.1 zu reproduzieren, wobei das Verhalten mit und ohne den Basispfad src/ verglichen wird. Untersuche vendor/phpdocumentor/reflection/src/phpDocumentor/Reflection/BaseReflector.php und die Handhabung durch tests/ des Parsers. Erledigt ist die Aufgabe, wenn der Parser mit der unterstützten Dependency aus der PHP-8.1-Ära funktioniert und die beschriebenen Syntax- oder Objektkonvertierungsfehler nicht mehr meldet.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- php
- Bereich
- documentation, tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Ruhig
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 35/100