Muntashir Al-Islam d02d384662 Add lint checker
2023-07-14 20:21:00 +06:00

14 lines
479 B
PHP

<?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));
}