| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 53 | public static function toEmoji( $str ) { |
||
| 54 | self::generateReverseMap(); |
||
| 55 | preg_match_all( '/&#[0-9a-fA-F]+;/', $str, $emoji_entity_list, PREG_PATTERN_ORDER ); |
||
| 56 | |||
| 57 | foreach ( $emoji_entity_list[ 0 ] as $emoji_entity ) { |
||
| 58 | if ( array_key_exists( $emoji_entity, self::$inverse_char_map ) ) { |
||
| 59 | $str = str_replace( $emoji_entity, self::$inverse_char_map[ $emoji_entity ], $str ); |
||
| 60 | } |
||
| 61 | } |
||
| 62 | |||
| 63 | return $str; |
||
| 64 | } |
||
| 66 | } |