Unable to parse ArrayTables that contain Tables
guillemcanal opened this issue ยท 3 comments
guillemcanal commented
It seems that the current implementation does not support tables contained within array tables :
<?php
use Yosymfony\Toml\Toml;
require dirname(__DIR__) . '/vendor/autoload.php';
$toml = <<<TOML
[[tls]]
entrypoints = ["https"]
[tls.certificate]
certFile = "certs/foo.crt"
keyFile = "keys/foo.key"
[[tls]]
entrypoints = ["https"]
[tls.certificate]
certFile = "certs/bar.crt"
keyFile = "keys/bar.key"
TOML;
Toml::parse($toml);
It throw the following exception :
Fatal error: Uncaught Yosymfony\ParserUtils\SyntaxErrorException: The key "tls.certificate" has already been defined previously.
https://www.tomllint.com/ indicate that to TOML content provided above is perfectly valid.
yosymfony commented
ok, I'll check it up
guillemcanal commented
@yosymfony Thank you so much :)
yosymfony commented
@guillemcanal It's fixed. In the coming days, I'm going to make a release.