Repository navigation
Package 3.3.0 adds explicit TOON wire-format selection while keeping existing calls compatible with release 3.2.1.
use HelgeSverre\Toon\EncodeOptions;
use HelgeSverre\Toon\DecodeOptions;
use HelgeSverre\Toon\SpecVersion;
use HelgeSverre\Toon\Toon;
$wire = Toon::encode($data, new EncodeOptions(version: SpecVersion::V4_4));
$data = Toon::decode($wire, new DecodeOptions(version: SpecVersion::V4_4));- Omitted versions retain the 3.3 compatibility profile; TOON 4.1 and 4.4 are explicit opt-ins. Package and wire-format versions are independent.
- Isolated codecs add comments, keyed tables, nested field groups, and version-specific strict/non-strict rules without changing legacy helper classes or option defaults.
- No runtime dependencies or optional extensions added. PHP 8.1–8.5 validated.
- Pinned official fixtures, released-behavior snapshots and generated round trips: 4,826 tests and 86,711 assertions pass on each supported PHP version.
- Symfony Mate's encoding/command suite passes against both 3.2.1 and 3.3.0 (174 tests, 620 assertions); response probes and real CLI outputs are byte-identical. The full standalone Mate suite retains the same unrelated bridge-reference failures on both versions.
- After publication, the actual Packagist package was installed under the unchanged
^3.2.1consumer constraint. Mate's encoding/command tests, response probe and a real project-defined tool all passed, with byte-identical output to 3.2.1. Both opt-in codecs also passed extension-free smoke checks against the published distribution on PHP 8.1–8.5.
Objects continue decoding to associative arrays; empty-object/list and sequential numeric-key distinctions may be lost after decoding. The default profile retains its documented legacy deviations.
Thanks to @voku for #6 and @zip-fa for #8 and #9. Their format work was adapted into the versioned codec architecture.
See version selection and compatibility, release validation, and the changelog.
Downstream comparison evidence includes synthetic response probes, real project tool outputs and the full Mate baseline/candidate logs. Its provenance file explains the existing standalone bridge-reference failures.