PHP 클래스 Telegram\Bot\Helpers\Emojify

파일 보기 프로젝트 열기: irazasyed/telegram-bot-sdk

보호된 프로퍼티들

프로퍼티 타입 설명
$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