public function generateEmojiPhpConstants()
	{

		$data = json_decode(file_get_contents(Wordsmith::$plugin->getBasePath() . '/libs/emoji.json'));

		$data = array_map(
			function($entry){

				$assumedName = !empty($entry->name) ? $entry->name : (string) Stringy::create($entry->short_name)->humanize()->toUpperCase();
				$constantName = (string) Stringy::create($assumedName)->toLowerCase()->replace('&', 'AND')->slugify('_')->toUpperCase();

				$char = '';
				foreach (explode('-', $entry->unified) as $code)
				{
					$char .= '\u{' . $code . '}';
				}

				return [
					'constantName' => $constantName,
					'unicode' => $char,
				];
			},
			$data
		);

		$output = '';

		foreach ($data as $emoji)
		{
			$output .= "\n" . "const {$emoji['constantName']} = \"{$emoji['unicode']}\";";
		}

		return $output;

	}
public function generateEmojiPhpConstants()
	{

		$data = json_decode(file_get_contents(Wordsmith::$plugin->getBasePath() . '/libs/emoji.json'));

		$data = array_map(
			function($entry){

				$assumedName = !empty($entry->name) ? $entry->name : (string) Stringy::create($entry->short_name)->humanize()->toUpperCase();
				$constantName = (string) Stringy::create($assumedName)->toLowerCase()->replace('&', 'AND')->slugify('_')->toUpperCase();

				$char = '';
				foreach (explode('-', $entry->unified) as $code)
				{
					$char .= '\u{' . $code . '}';
				}

				return [
					'constantName' => $constantName,
					'unicode' => $char,
				];
			},
			$data
		);

		$output = '';

		foreach ($data as $emoji)
		{
			$output .= "\n" . "const {$emoji['constantName']} = \"{$emoji['unicode']}\";";
		}

		return $output;

	}
public function generateEmojiPhpConstants ( ) { $ data = json_decode ( file_get_contents ( Wordsmith :: $ plugin -> getBasePath ( ) . '/libs/emoji.json' ) ) ; $ data = array_map ( function ( $ entry ) { $ assumedName = ! empty ( $ entry -> name ) ? $ entry -> name : ( string ) Stringy :: create ( $ entry -> short_name ) -> humanize ( ) -> toUpperCase ( ) ; $ constantName = ( string ) Stringy :: create ( $ assumedName ) -> toLowerCase ( ) -> replace ( '&' , 'AND' ) -> slugify ( '_' ) -> toUpperCase ( ) ; $ char = '' ; foreach ( explode ( '-' , $ entry -> unified ) as $ code ) { $ char .= '\u{' . $ code . '}' ; } return [ 'constantName' => $ constantName , 'unicode' => $ char , ] ; } , $ data ) ; $ output = '' ; foreach ( $ data as $ emoji ) { $ output .= "\n" . "const {$emoji['constantName']} = \"{$emoji['unicode']}\";" ; } return $ output ; }
For internal use only.

We use this function to reformat data from the source-of-truth JSON in order to create the code for \libs\Emoji.php

@return string
For internal use only .