Skip to content

Commit

Permalink
Fix TOML subkeys
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadyita committed Mar 1, 2024
1 parent 1a29d50 commit 2ed718b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/TOML.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ public static function export(mixed $in): string {
if (array_is_list($data)) {
foreach ($data as $block) {
$builder->addArrayOfTable($key);
foreach ($block as $key => $value) {
foreach ($block as $subkey => $value) {
if (isset($value)) {
$builder->addValue($key, $value);
$builder->addValue($subkey, $value);
}
}
}
} else {
$builder->addTable($key);
foreach ($data as $key => $value) {
foreach ($data as $subkey => $value) {
if (isset($value)) {
$builder->addValue($key, $value);
$builder->addValue($subkey, $value);
}
}
}
Expand Down

0 comments on commit 2ed718b

Please sign in to comment.