Skip to content

Releases: manojrammurthy/toon-php-lite

v0.3.0 - Nested objects decoding

Choose a tag to compare

@manojrammurthy manojrammurthy released this 18 Nov 05:54

✨ Added

Nested object decoding
You can now write YAML-style nested TOON:

user:
id: 1
name: Manoj

Better internal error messages (line numbers, row contexts)

Tightened row-count validation for:

primitive arrays

list blocks

tabular blocks

🛠 Improved

Decoder internals refactored to be cleaner and fully indentation-aware

PHPStan clean run (0 errors) with updated rules

🧪 Testing

Added round-trip tests for nested structures

100% test suite passing (24 tests, 46 assertions)

v0.2.0 – Comments, EncodeOptions & Better Errors

Choose a tag to compare

@manojrammurthy manojrammurthy released this 14 Nov 10:43

Added

  • EncodeOptions for configurable indentation and optional trailing newline in Toon::encode().
  • Comment support in decoder (# and //, both full-line and inline).
  • Improved DecodeException messages with line numbers and offending lines.

Notes

This should be backwards compatible with existing usage:

  • Toon::encode($data) still behaves the same.
  • New features are opt-in via EncodeOptions.

v0.1.0 – Initial release

Choose a tag to compare

@manojrammurthy manojrammurthy released this 13 Nov 12:33

🎉 First release of TOON PHP Lite

This is the initial public release of TOON PHP Lite, a lightweight PHP library for encoding and decoding TOON (Token-Oriented Object Notation).

✨ Features

  • ToonLite\Toon::encode(mixed $data): string

    • Encodes:
      • associative arrays → key: value
      • primitive lists → key[n]: a,b,c
      • uniform list of objects → key[n]{col1,col2}: tabular format
      • mixed/other lists → list format
  • ToonLite\Toon::decode(string $toon): mixed

    • Parses:
      • key: value
      • key[n]: a,b,c
      • key[n]{a,b,c}: + tabular rows
      • key[n]: with - value items
  • Zero runtime dependencies

  • Tested with PHPUnit

  • GitHub Actions CI for PHP 8.1, 8.2, 8.3

🔧 Requirements

  • PHP >= 8.1

📦 Install

composer require manoj/toon-php-lite