Skip to content

Commit e7be30e

Browse files
lyrixxnicolas-grekas
authored andcommitted
[Intl] Fixed return type of EmojiTransliterator::create() and some others methods
1 parent 2835b39 commit e7be30e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Transliterator/EmojiTransliterator.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ trait EmojiTransliteratorTrait
4949
private array $map;
5050
private \Transliterator $transliterator;
5151

52-
public static function create(string $id, int $direction = self::FORWARD): ?\Transliterator
52+
public static function create(string $id, int $direction = self::FORWARD): self
5353
{
5454
$id = strtolower($id);
5555

@@ -89,7 +89,7 @@ public static function create(string $id, int $direction = self::FORWARD): ?\Tra
8989
return $instance;
9090
}
9191

92-
public function createInverse(): ?self
92+
public function createInverse(): self
9393
{
9494
return self::create($this->id, self::REVERSE);
9595
}
@@ -104,11 +104,13 @@ public function getErrorMessage(): string|false
104104
return $this->transliterator?->getErrorMessage() ?? false;
105105
}
106106

107-
public static function listIDs(): array|false
107+
public static function listIDs(): array
108108
{
109-
static $ids;
109+
static $ids = [];
110110

111-
$ids = [];
111+
if ($ids) {
112+
return $ids;
113+
}
112114

113115
foreach (scandir(\dirname(__DIR__).'/Resources/data/transliterator/emoji/') as $file) {
114116
if (str_ends_with($file, '.php')) {

0 commit comments

Comments
 (0)