vanodevium / toml

PHP library for encoding and decoding TOML
MIT License
21 stars 0 forks source link

Serde integration #1

Closed Crell closed 1 month ago

Crell commented 2 months ago

Neato!

I have had an outstanding request (https://github.com/Crell/Serde/issues/40) for a while to support TOML in Crell/Serde. The main blocker has been a 1.0-compatible TOML parser. I think that means we're unblocked now. :smile:

I want to confirm, since the docs are still a little sparse: this round-trips TOML to a nested array, much like Symfony/Yaml, correct? If so, supporting it should be reasonably straightforward. Any interest in helping with that?

vanodevium commented 2 months ago

@Crell

Hi! You got it right: this library works with TOML the way symfony/yaml does with YAML.

When parsing, either a multi-level array or an object is returned, you specify it yourself.

toml_decode($toml, true); // returns array
toml_decode($toml, false); // returns object

As you can see, this is json_decode behavior :)

So there is no problem to help you with integration and testing. You are welcome!

vanodevium commented 1 month ago

Done!