src/Slack/EmojiIcon.php
private function setEmoji($emoji)
    {
        // remove the whitespace
        $emoji = trim($emoji);

        $emojiValidationRegex = '_^:[\w-+]+:$_iuS';
        if (!preg_match($emojiValidationRegex, $emoji)) {
            throw new InvalidEmojiException(
                sprintf(
                    'The emoji: "%s" is not a valid emoji.
                     An emoji should always be a string starting and ending with ":".',
                    $emoji
                ),
                400
            );
        }
        $this->emoji = $emoji;

        return $this;
    }
private function setEmoji($emoji)
    {
        // remove the whitespace
        $emoji = trim($emoji);

        $emojiValidationRegex = '_^:[\w-+]+:$_iuS';
        if (!preg_match($emojiValidationRegex, $emoji)) {
            throw new InvalidEmojiException(
                sprintf(
                    'The emoji: "%s" is not a valid emoji.
                     An emoji should always be a string starting and ending with ":".',
                    $emoji
                ),
                400
            );
        }
        $this->emoji = $emoji;

        return $this;
    }
private function setEmoji ( $ emoji ) { // remove the whitespace $ emoji = trim ( $ emoji ) ; $ emojiValidationRegex = '_^:[\w-+]+:$_iuS' ; if ( ! preg_match ( $ emojiValidationRegex , $ emoji ) ) { throw new InvalidEmojiException ( sprintf ( 'The emoji: "%s" is not a valid emoji.
                     An emoji should always be a string starting and ending with ":".' , $ emoji ) , 400 ) ; } $ this -> emoji = $ emoji ; return $ this ; }
This will set the emoji if it is valid.

@param string $emoji

@throws InvalidEmojiException Thrown when the emoji is not valid

@return $this
This will set the emoji if it is valid .