7
7
class Emoji {
8
8
9
9
/**
10
- * Quotes
11
- * @var collection
12
- */
13
- protected $ quotes ;
14
-
15
- /**
16
- * Get the Quotes from the respective files depending on the Category
17
- * @param string $category
10
+ * Get the Emojis from emoji.php
18
11
* @return array
19
12
*/
20
13
private function getEmojis ()
21
14
{
22
15
return require ("Emojis/emoji.php " );
23
16
}
24
17
18
+ /**
19
+ * Get the emoji by passing the commonly used emoji name
20
+ * @param string $emojiName
21
+ * @return unicode
22
+ * @throws \Unicodeveloper\Emoji\Exceptions\IsNull
23
+ * @throws \Unicodeveloper\Emoji\Exceptions\UnknownUnicode
24
+ */
25
25
public function findByAlias ($ emojiName = null )
26
26
{
27
27
if (is_null ($ emojiName )) {
@@ -37,11 +37,24 @@ public function findByAlias($emojiName = null)
37
37
return $ this ->getEmojis ()[$ emoji ];
38
38
}
39
39
40
+ /**
41
+ * Get the emoji by passing the commonly used emoji name
42
+ * Alias for findByAlias
43
+ * @param string $emojiName
44
+ * @return unicode
45
+ */
40
46
public function findByName ($ emojiName = null )
41
47
{
42
48
return $ this ->findByAlias ($ emojiName );
43
49
}
44
50
51
+ /**
52
+ * Get the emoji name by passing the unicode value
53
+ * @param string $unicode
54
+ * @return string
55
+ * @throws \Unicodeveloper\Emoji\Exceptions\IsNull
56
+ * @throws \Unicodeveloper\Emoji\Exceptions\UnknownUnicode
57
+ */
45
58
public function findByUnicode ($ unicode = null )
46
59
{
47
60
if (is_null ($ unicode )) {
@@ -57,6 +70,12 @@ public function findByUnicode($unicode = null)
57
70
return $ emojis [$ unicode ];
58
71
}
59
72
73
+ /**
74
+ * Ensure that a proper exception is thrown for methods that do not exist
75
+ * @param string $method
76
+ * @param array $parameters
77
+ * @throws \Unicodeveloper\Emoji\Exceptions\UnknownMethod
78
+ */
60
79
public function __call ($ method , $ parameters )
61
80
{
62
81
if (! method_exists (new static , $ method )) {
0 commit comments