We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd2d3af commit 4d56f7aCopy full SHA for 4d56f7a
src/Emoji.php
@@ -37,7 +37,7 @@ public function findByAlias($emojiName = null)
37
38
public function findByName($emojiName = null)
39
{
40
- $this->findByAlias($emojiName);
+ return $this->findByAlias($emojiName);
41
}
42
43
public function findByUnicode($unicode = null)
@@ -46,9 +46,13 @@ public function findByUnicode($unicode = null)
46
throw new \Exception("Please provide a valid UTF-8 Unicode value");
47
48
49
- $emoji = array_flip($this->getEmojis());
+ $emojis = array_flip($this->getEmojis());
50
51
- return $emoji[$unicode];
+ if (! array_key_exists($unicode, $emojis)) {
52
+ throw new \Exception("Emoji Not Found, Man. Please provide a valid UTF-8 Unicode value");
53
+ }
54
+
55
+ return $emojis[$unicode];
56
57
58
0 commit comments