API / Minn\Content / Emoji

Emoji final class

Minn\Content\Emoji · public/minn/src/Minn/Content/Emoji.php · 68 lines

Emoji as the reference's mail and feeds carry them, from the list the reference ships (data/emoji.json, read from it): encode() turns each emoji character into its entity; staticize() turns each listed sequence in the text (outside tags, and outside code and pre) into a CDN image, longest sequence first. Text that already holds an entity is not encoded first; once anything matched, the variation selectors left over are dropped.

Uses 1

Constants and properties

privateIGNORED = array ( 0 => 'code', 1 => 'pre', )
privatestatic ?array $list

Public

staticencode(string $text): string#

Each emoji character in the text as its hexadecimal entity.

staticstaticize(string $text, string $baseUrl, string $extension): string#

The text with its emoji as images under $baseUrl (each file named for its code points, $extension after).

Internals 2

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privatereplaceInText(string $text, array $images): string#

The replacements made in text runs only, never inside a tag or a code or pre element. @param array<string, string> $images

$imagesarray<string, string>
privatelist(): array#
@return array{entities: list<string>, partials: list<string>}