Skip to content

Commit 228d93c

Browse files
authored
Merge pull request #384 from zigzagdev/chore/clean-up-commmands
Refactor about Command files
2 parents 646d8a9 + bf4635e commit 228d93c

17 files changed

Lines changed: 132 additions & 1687 deletions

src/app/Console/Commands/AlgoliaImportWorldHeritages.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,6 @@ public function handle(): int
145145
return;
146146
}
147147

148-
if ((int) $row->id === 1133) {
149-
dd([
150-
'state_party_codes' => $statePartyCodes,
151-
'country_names_jp' => $countryNamesJp,
152-
'object' => end($objects),
153-
]);
154-
}
155-
156148
$res = $client->saveObjects(
157149
indexName: $indexName,
158150
objects: $objects

src/app/Console/Commands/BackfillStateParties.php

Lines changed: 0 additions & 76 deletions
This file was deleted.

src/app/Console/Commands/BackfillThumbnailImageId.php

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/app/Console/Commands/BuildWorldHeritageLocalDb.php

Lines changed: 0 additions & 105 deletions
This file was deleted.

src/app/Console/Commands/DumpUnescoWorldHeritageJson.php

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -487,49 +487,4 @@ private function normalizeRow(array $row): array
487487
'components_count' => $toInt($row['components_count'] ?? null),
488488
];
489489
}
490-
491-
private function buildCriteriaFromDumpRow(array $row): array
492-
{
493-
$raw = $row['criteria_txt'] ?? null;
494-
495-
if (!is_string($raw)) {
496-
return [];
497-
}
498-
$raw = trim($raw);
499-
if ($raw === '') {
500-
return [];
501-
}
502-
503-
preg_match_all('/\(\s*([ivxlcdm]+)\s*\)/i', $raw, $m1);
504-
$vals = $m1[1] ?? [];
505-
506-
if (!is_array($vals) || $vals === []) {
507-
preg_match_all('/\b([ivxlcdm]{1,6})\b/i', $raw, $m2);
508-
$vals = $m2[1] ?? [];
509-
}
510-
511-
if (!is_array($vals) || $vals === []) {
512-
return [];
513-
}
514-
515-
$out = [];
516-
$seen = [];
517-
518-
foreach ($vals as $v) {
519-
$v = strtolower(trim((string) $v));
520-
if ($v === '') {
521-
continue;
522-
}
523-
if (!preg_match('/^[ivxlcdm]+$/', $v)) {
524-
continue;
525-
}
526-
527-
if (!isset($seen[$v])) {
528-
$seen[$v] = true;
529-
$out[] = $v;
530-
}
531-
}
532-
533-
return $out;
534-
}
535490
}

0 commit comments

Comments
 (0)