respect-validation/tests/unit/Message
Alexandre Gomes Gaigalas cd96d01364 Fix message overriding bug in NestedArrayFormatter
This commit resolves an issue where validation messages would overwrite
each other when multiple validators failed on the same path or key
(e.g., within an `Each` or `Key` validator).

Changes to `NestedArrayFormatter`:
- Implemented a merge strategy: Key collisions now result in a list of
  messages instead of the last message winning.
- Improved handling of mixed key types: When both numeric and string
  keys are present (common in composite validators), numeric keys are now
  replaced by the validator's ID (e.g., `arrayType`, `equals`) to provide
  meaningful, distinct keys.
- Preserved list behavior: Purely numeric key sets are treated as lists,
  maintaining their sequence without re-keying logic.
- Refactored the class to use smaller, single-purpose methods and
  `array_reduce` for clarity.

Tests:
- Updated feature tests (`EachTest`, `AttributesTest`, etc.) to expect the
  full set of validation errors.
- Enhanced `NestedArrayFormatterTest` with scenarios for key collisions,
  mixed keys, and ID substitution.
2026-01-12 10:42:11 +00:00
..
Formatter Fix message overriding bug in NestedArrayFormatter 2026-01-12 10:42:11 +00:00
Modifier Enable adding modifiers without changing InterpolationRenderer 2025-12-30 11:17:11 +01:00
StandardFormatter Split the Formatter into different formatters 2025-12-19 16:20:28 +01:00
Stringifier Ensure formatters only format, not modify results 2026-01-03 19:47:30 +01:00
Translator Upgrade translation mechanism 2024-12-05 15:42:40 +01:00
InterpolationRendererTest.php Do not instantiate objects in the constructor of core classes 2026-01-04 15:46:40 +01:00