KomifloResolver タグをsort

This commit is contained in:
Irie Aoi 2020-12-11 02:38:22 +09:00
parent 2778d34711
commit 330facf974

View File

@ -41,9 +41,12 @@ class KomifloResolver implements Resolver
// タグ // タグ
if (!empty($json['content']['attributes']['tags']['children'])) { if (!empty($json['content']['attributes']['tags']['children'])) {
$tags = [];
foreach ($json['content']['attributes']['tags']['children'] as $tag) { foreach ($json['content']['attributes']['tags']['children'] as $tag) {
$metadata->tags[] = preg_replace('/\s/', '_', $tag['data']['name']); $tags[] = preg_replace('/\s/', '_', $tag['data']['name']);
} }
sort($tags);
$metadata->tags = array_merge($metadata->tags,$tags);
} }
return $metadata; return $metadata;