Add lint checker

This commit is contained in:
Muntashir Al-Islam
2023-07-14 20:21:00 +06:00
parent e25b427972
commit d02d384662
9 changed files with 254 additions and 19 deletions

13
scripts/test.php Normal file
View File

@ -0,0 +1,13 @@
<?php
$json_files = array_filter(scandir(__DIR__), function ($item) {
return str_ends_with($item, ".json");
});
foreach ($json_files as $json_file) {
$list = json_decode(file_get_contents(__DIR__ . 'test.php/' . $json_file), true);
usort($list, function ($o1, $o2) {
return $o1['id'] <=> $o2['id'];
});
file_put_contents(__DIR__ . 'test.php/' . $json_file, json_encode($list, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT));
}