prettier / prettier/plugin-php
PHP 8.5 not supported?
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- PHP
- Sterne
- 1.9k
- Forks
- 139
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
With PHP 8.5 the new pipe operator has been introduced.
Unfortunately it seems that prettier/plugin-php isn't able to format correctly and throws an error.
I have PHP 8.5 installed and I don't use composer, just plain old PHP.
2026-01-29T12:14:37+01:00 ERROR [project::lsp_store] Formatting failed: default prettier instance failed to format buffer: SyntaxError: Parse Error : syntax error, unexpected '>' on line 137
135 | {
136 | return array_map(fn($part) => trim($part, DIRECTORY_SEPARATOR), $parts)
> 137 | |> fn(array $paths) => implode(DIRECTORY_SEPARATOR, $paths)
| ^
138 | |> fn(string $path) => preg_replace("#" . DIRECTORY_SEPARATOR . "+#", DIRECTORY_SEPARATOR, $path);
139 | }
140 | }
While handling prettier request: {"jsonrpc":"2.0","id":3,"method":"prettier/format","params":{"text":"..snip..","options":{"plugins":[".../Zed/prettier/node_modules/@prettier/plugin-php/standalone.js"],"parser":"php","filepath":"some filepath","prettierOptions":{"tabWidth":2,"printWidth":100,"useTabs":false,"phpVersion":"auto"},"ignorePath":null}}}
Beitragsleitfaden
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
Reproduziere den Fehler mit dem Standalone-Parser von prettier/plugin-php anhand des Beispiels für den Pipe-Operator in PHP 8.5 und den gezeigten Parser-Optionen. Verfolge den Einstiegspunkt des PHP-Parsers für das unerwartete Token; abgeschlossen ist die Aufgabe, wenn das Beispiel ohne einen Parse-Fehler erfolgreich formatiert wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- php
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 55/100