Add alternate array index style, with setting

This commit is contained in:
2024-10-07 00:58:34 +02:00
parent 0e1354bd47
commit 73ac4dd3f6
3 changed files with 13 additions and 2 deletions

View File

@@ -16,6 +16,8 @@ class Settings
public static bool $tailLine = true;
public static bool $highlightIndices = true;
public static function load(string $filename): void
{
if (file_exists($filename) && is_readable($filename)) {
@@ -25,6 +27,7 @@ class Settings
self::$indentationGuides = $data->indentationGuides ?? true;
self::$collapseBefore = $data->collapseBefore ?? true;
self::$tailLine = $data->tailLine ?? true;
self::$highlightIndices = $data->highlightIndices ?? true;
}
}
@@ -37,6 +40,7 @@ class Settings
'collapseBefore' => self::$collapseBefore,
'highlightRow' => self::$highlightRow,
'tailLine' => self::$tailLine,
'highlightIndices' => self::$highlightIndices,
], JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT)."\n";
@file_put_contents($filename, $data);
}