Skip to content

[Sync EN] Sync enumerations chapter (interactive samples, error message updates)#249

Open
lacatoire wants to merge 1 commit into
php:masterfrom
lacatoire:sync-en/enumerations
Open

[Sync EN] Sync enumerations chapter (interactive samples, error message updates)#249
lacatoire wants to merge 1 commit into
php:masterfrom
lacatoire:sync-en/enumerations

Conversation

@lacatoire
Copy link
Copy Markdown
Member

Bringt language/enumerations.xml auf den Stand von upstream doc-en (1eb67bea30). Die englische Seite wurde überwiegend umstrukturiert, um die Run code-Funktion auf php.net zu unterstützen.

Änderungen:

  • annotations="interactive" auf dem <chapter>-Element aktiviert das Inline-Ausführen der Codebeispiele auf php.net.
  • Die meisten <programlisting>-Blöcke sind nun in <informalexample> gewrappt; die jeweilige Enum-Definition (Suit, UserStatus, Size) wird vor dem Beispielcode wiederholt, damit jedes Beispiel eigenständig läuft.
  • Beispiele, die nicht eigenständig laufen können, sind mit annotations="non-interactive" markiert.
  • Einzeiler-Platzhalter ($a === $b; // true) wurden durch sichtbar ausgebende Varianten ersetzt (if (...) { print ...; }, var_dump, printf mit htmlentities); die get_stuff_from_database-Stelle hat jetzt einen vollständigen Stub.
  • Fehlermeldung aktualisiert: Cannot acquire reference to property Suit::$valueCannot indirectly modify readonly property Suit::$value.
  • Fehlermeldung aktualisiert: is not a valid scalar value for enum "Suit"is not a valid backing scalar value for enum Suit.
  • Reihenfolge des from()/tryFrom()-Beispiels gemäß EN angepasst.

Deutsche Prosa und übersetzte Code-Kommentare wurden bewusst beibehalten. Bestehender Maintainer: (samesch) wurde beibehalten.

Schließt indirekt #88 (der ursprüngliche static/self-Fix war bereits via Sync with EN in bff9d5eb87 enthalten; mit diesem Sync ist die Datei jetzt vollständig auf dem aktuellen Stand).

…ge updates)

Brings language/enumerations.xml up to date with the upstream rewrite
(EN-Revision 1eb67bea30f61f7d9cdfd371146911a0ba07bbd2):

- Add annotations="interactive" on the chapter element to enable
  inline "Run code" on php.net pages.
- Wrap most <programlisting> samples in <informalexample> and prepend
  the relevant enum definition so each sample runs standalone.
- Mark a few samples that cannot run standalone with
  annotations="non-interactive".
- Replace placeholder one-liners with real output-producing code
  (var_dump, print, htmlentities, get_stuff_from_database stub).
- Update an error message: "Cannot acquire reference to property
  Suit::$value" → "Cannot indirectly modify readonly property
  Suit::$value".
- Update the from() error message: "is not a valid scalar value for
  enum Suit" → "is not a valid backing scalar value for enum Suit".
- Reorder the from()/tryFrom() example so tryFrom() comes first.

German prose and translated code comments preserved.
Existing Maintainer (samesch) is kept.
@lacatoire lacatoire force-pushed the sync-en/enumerations branch from 6694f73 to 949a76c Compare May 29, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant