PHP Класс Telegram\Bot\Helpers\Emojify

Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$emojiMap array The array mapping words to emoji.
$emojiMapFile string The path to the file containing the emoji map.
$wordMap array The array mapping emoji back to words.

Открытые методы

Метод Описание
getInstance ( ) : Emojify Returns the *Singleton* instance of this class.
setEmojiMapFile ( string $emojiMapFile ) : Emojify Set File Path to Emoji Map File.
text ( $text ) : mixed Alias of toEmoji()
toEmoji ( $text ) : mixed Translate Word to Emoji
toWord ( $text ) : mixed Translate Emoji to Word
translate ( $text ) : mixed Alias of toWord()

Защищенные методы

Метод Описание
__construct ( ) Protected Emojify constructor to prevent creating a new instance of the *Singleton* via the new operator from outside of this class.
emojiToWordReplace ( $line, $replace, $delimiter ) : mixed Finds emojis and replaces them with text enclosed by the delimiter
getEmojiMap ( ) : array Get Emoji Map Array.
replace ( $line, $replace, boolean $toWord = false, string $delimiter = ':' ) : mixed Replace
setupEmojiMaps ( ) Setup Emoji Maps.
wordToEmojiReplace ( $line, $replace, $delimiter ) : mixed Finds words enclosed by the delimiter and converts them to the appropriate emoji character.

Приватные методы

Метод Описание
__clone ( ) : void Private clone method to prevent cloning of the instance of the *Singleton* instance.
__wakeup ( ) : void Private unserialize method to prevent unserializing of the *Singleton* instance.

Описание методов

__construct() защищенный Метод

Protected Emojify constructor to prevent creating a new instance of the *Singleton* via the new operator from outside of this class.
protected __construct ( )

emojiToWordReplace() защищенный Метод

Finds emojis and replaces them with text enclosed by the delimiter
protected emojiToWordReplace ( $line, $replace, $delimiter ) : mixed
$line
$replace
$delimiter
Результат mixed

getEmojiMap() защищенный Метод

Get Emoji Map Array.
protected getEmojiMap ( ) : array
Результат array

getInstance() публичный статический Метод

Returns the *Singleton* instance of this class.
public static getInstance ( ) : Emojify
Результат Emojify The *Singleton* instance.

replace() защищенный Метод

Replace
protected replace ( $line, $replace, boolean $toWord = false, string $delimiter = ':' ) : mixed
$line
$replace
$toWord boolean
$delimiter string
Результат mixed

setEmojiMapFile() публичный Метод

Set File Path to Emoji Map File.
public setEmojiMapFile ( string $emojiMapFile ) : Emojify
$emojiMapFile string
Результат Emojify

setupEmojiMaps() защищенный Метод

Setup Emoji Maps.
protected setupEmojiMaps ( )

text() публичный статический Метод

Alias of toEmoji()
public static text ( $text ) : mixed
$text
Результат mixed

toEmoji() публичный Метод

Translate Word to Emoji
public toEmoji ( $text ) : mixed
$text
Результат mixed

toWord() публичный Метод

Translate Emoji to Word
public toWord ( $text ) : mixed
$text
Результат mixed

translate() публичный статический Метод

Alias of toWord()
public static translate ( $text ) : mixed
$text
Результат mixed

wordToEmojiReplace() защищенный Метод

Finds words enclosed by the delimiter and converts them to the appropriate emoji character.
protected wordToEmojiReplace ( $line, $replace, $delimiter ) : mixed
$line
$replace
$delimiter
Результат mixed

Описание свойств

$emojiMap защищенное свойство

The array mapping words to emoji.
protected array $emojiMap
Результат array

$emojiMapFile защищенное свойство

The path to the file containing the emoji map.
protected string $emojiMapFile
Результат string

$wordMap защищенное свойство

The array mapping emoji back to words.
protected array $wordMap
Результат array