Review main Merged

92323[TASK] Avoid `json_encode()` workarounds in Settings API

Benjamin Franzke CR +2 V +2 Easy +27 −21 updated 04/02/26, 10:47

Commit message

Force creation of objects for string indexed arrays
in `json_encode()`, by casting arrays to objects, in
order to avoid workarounds in JavaScript that handle
incoming values as `Array` or `Object` type, because
`json_encode()` encodes `[]` or `['0' => 'foo']` as JSON
array (`[]`/`["foo"]`) while `['foo' => 'bar']` is
encoded as JSON object (`{"foo": "bar"}`).

This is done in preparation for generating and validating
to a reliable schema, that can use json-schema to
describe the expected structure.

Also add more phpdoc annotations to ensure we can statically
analyze that we use and provide correct and reliable types.

The unused `toArray()` methods are reduced to
declutter the code. Note: This is not considered breaking
since #108574 made the `SettingDefinition` class non-internal
very recently, therefore want to harden the class by removing
unused and therefore unsupported functionality.

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Josua Vogel +1
    • Benjamin Kott +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Josua Vogel +1
    • Benjamin Kott +1
    • core-ci +1 CI

Issues 1

Files 4

Review log 1522

  1. Benjamin Franzke uploaded patch set 1 01/13/26, 20:27

  2. core-ci voted on patch set 1 V +1 01/13/26, 20:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/93405

  3. Benjamin Franzke rebased onto patch set 2 V +1 01/27/26, 10:00

  4. Benjamin Franzke rebased onto patch set 3 02/06/26, 15:42

  5. Benjamin Franzke rebased onto patch set 4 02/28/26, 10:24

  6. core-ci voted on patch set 4 V -1 02/28/26, 11:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97022

  7. Benjamin Franzke rebased onto patch set 5 V -1 02/28/26, 17:29

  8. core-ci voted on patch set 5 V +1 02/28/26, 17:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97032

  9. Benjamin Franzke uploaded patch set 6 V +1 03/03/26, 17:23

  10. Benjamin Franzke marked it ready for review 03/03/26, 17:24

  11. Benjamin Franzke wrote 03/03/26, 17:27

    Hashtag added: actions
  12. core-ci voted on patch set 6 V +1 03/03/26, 17:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97205

  13. Benjamin Franzke rebased onto patch set 7 V +1 03/27/26, 20:17

  14. core-ci voted on patch set 7 V +1 03/27/26, 21:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98918

  15. Benjamin Franzke rebased onto patch set 8 V +1 03/30/26, 08:30

  16. core-ci voted on patch set 8 V +1 03/30/26, 09:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99013

  17. Benjamin Franzke rebased onto patch set 9 V +1 04/02/26, 07:39

  18. core-ci voted on patch set 9 V +1 04/02/26, 07:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/99444

  19. Benjamin Kott voted on patch set 9 CR +1 V +1 04/02/26, 08:13

  20. Josua Vogel voted on patch set 9 CR +1 V +1 04/02/26, 10:40

  21. Benjamin Franzke voted on patch set 9 CR +2 V +2 04/02/26, 10:47

  22. Benjamin Franzke merged patch set 10 04/02/26, 10:47