Skip to content

Commit fd0d3c0

Browse files
minor #60190 [Emoji] Update the list of emojis to the latest version for Gitlab (lyrixx)
This PR was merged into the 7.2 branch. Discussion ---------- [Emoji] Update the list of emojis to the latest version for Gitlab | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | fix internal tooling | New feature? | no | Deprecations? | no | Issues | | License | MIT This also fixes the internal tooling used to perform the update. Commits ------- 8631a2a [Emoji] Fix build of gitlab emoji + update them
2 parents 91ed2eb + 8631a2a commit fd0d3c0

File tree

6 files changed

+7732
-1745
lines changed

6 files changed

+7732
-1745
lines changed

src/Symfony/Component/Emoji/Resources/bin/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
update: ## Update sources
55
@composer update
66
@curl https://api.github.com/emojis > vendor/github-emojis.json
7-
@curl https://gitlab.com/gitlab-org/gitlab/-/raw/master/fixtures/emojis/index.json > vendor/gitlab-emojis.json
7+
@curl https://gitlab.com/gitlab-org/gitlab/-/raw/master/fixtures/emojis/digests.json > vendor/gitlab-emojis.json
88
@curl https://raw.githubusercontent.com/iamcal/emoji-data/master/emoji.json > vendor/slack-emojis.json
99
@curl -L https://unicode.org/Public/emoji/latest/emoji-test.txt > vendor/emoji-test.txt
1010

src/Symfony/Component/Emoji/Resources/bin/build.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,10 @@ public static function buildGitlabMaps(array $emojisCodePoints): array
149149
$emojis = json_decode((new Filesystem())->readFile(__DIR__.'/vendor/gitlab-emojis.json'), true, flags: JSON_THROW_ON_ERROR);
150150
$maps = [];
151151

152-
foreach ($emojis as $emojiItem) {
152+
foreach ($emojis as $shortName => $emojiItem) {
153153
$emoji = $emojiItem['moji'];
154154
$emojiPriority = mb_strlen($emoji) << 1;
155-
$maps[$emojiPriority + 1][$emojiItem['shortname']] = $emoji;
156-
157-
foreach ($emojiItem['aliases'] as $alias) {
158-
$maps[$emojiPriority][$alias] = $emoji;
159-
}
155+
$maps[$emojiPriority + 1][":$shortName:"] = $emoji;
160156
}
161157

162158
return $maps;

0 commit comments

Comments
 (0)