Completed
Push — master ( 6c20d0...7e41cb )
by Bahri Meriç
02:27
created
src/Emoji.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 	# WARNING:
5 5
 	# This code is auto-generated. Do not modify it manually.
6 6
 	#
7
-    $GLOBALS['emoji_maps'] = array(
7
+	$GLOBALS['emoji_maps'] = array(
8 8
 		'name_to_unified' => array(
9 9
 			'[BLACK SUN WITH RAYS]'=>                    "\xe2\x98\x80",                                                 
10 10
 			'[CLOUD]'=>                                  "\xe2\x98\x81",                     
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -3509,24 +3509,24 @@  discard block
 block discarded – undo
3509 3509
 	# functions to convert incoming data into the unified format
3510 3510
 	#
3511 3511
 
3512
-	function emoji_docomo_to_unified(	$text){ return emoji_convert($text, 'docomo_to_unified'); }
3513
-	function emoji_kddi_to_unified(		$text){ return emoji_convert($text, 'kddi_to_unified'); }
3514
-	function emoji_softbank_to_unified(	$text){ return emoji_convert($text, 'softbank_to_unified'); }
3515
-	function emoji_google_to_unified(	$text){ return emoji_convert($text, 'google_to_unified'); }
3512
+	function emoji_docomo_to_unified($text) { return emoji_convert($text, 'docomo_to_unified'); }
3513
+	function emoji_kddi_to_unified($text) { return emoji_convert($text, 'kddi_to_unified'); }
3514
+	function emoji_softbank_to_unified($text) { return emoji_convert($text, 'softbank_to_unified'); }
3515
+	function emoji_google_to_unified($text) { return emoji_convert($text, 'google_to_unified'); }
3516 3516
 
3517 3517
 
3518 3518
 	#
3519 3519
 	# functions to convert unified data into an outgoing format
3520 3520
 	#
3521 3521
 
3522
-	function emoji_unified_to_docomo(	$text){ return emoji_convert($text, 'unified_to_docomo'); }
3523
-	function emoji_unified_to_kddi(		$text){ return emoji_convert($text, 'unified_to_kddi'); }
3524
-	function emoji_unified_to_softbank(	$text){ return emoji_convert($text, 'unified_to_softbank'); }
3525
-	function emoji_unified_to_google(	$text){ return emoji_convert($text, 'unified_to_google'); }
3526
-	function emoji_unified_to_html(		$text){ return emoji_convert($text, 'unified_to_html'); }
3527
-	function emoji_html_to_unified(		$text){ return emoji_convert($text, 'html_to_unified');}
3528
-	function emoji_unified_to_name($text)  {return emoji_convert($text, 'unified_to_name'); }
3529
-	function emoji_name_to_unified($text)  {return emoji_convert($text, 'name_to_unified');}
3522
+	function emoji_unified_to_docomo($text) { return emoji_convert($text, 'unified_to_docomo'); }
3523
+	function emoji_unified_to_kddi($text) { return emoji_convert($text, 'unified_to_kddi'); }
3524
+	function emoji_unified_to_softbank($text) { return emoji_convert($text, 'unified_to_softbank'); }
3525
+	function emoji_unified_to_google($text) { return emoji_convert($text, 'unified_to_google'); }
3526
+	function emoji_unified_to_html($text) { return emoji_convert($text, 'unified_to_html'); }
3527
+	function emoji_html_to_unified($text) { return emoji_convert($text, 'html_to_unified'); }
3528
+	function emoji_unified_to_name($text) {return emoji_convert($text, 'unified_to_name'); }
3529
+	function emoji_name_to_unified($text) {return emoji_convert($text, 'name_to_unified'); }
3530 3530
 	function emoji_name_to_empty($text) {
3531 3531
 		return str_replace(array_keys($GLOBALS['emoji_maps']['name_to_unified']), '', $text);
3532 3532
 	}
@@ -3535,11 +3535,11 @@  discard block
 block discarded – undo
3535 3535
 	}
3536 3536
 
3537 3537
 
3538
-	function emoji_convert($text, $map){
3538
+	function emoji_convert($text, $map) {
3539 3539
 		return str_replace(array_keys($GLOBALS['emoji_maps'][$map]), $GLOBALS['emoji_maps'][$map], $text);
3540 3540
 	}
3541 3541
 
3542
-	function emoji_get_name($unified_cp){
3542
+	function emoji_get_name($unified_cp) {
3543 3543
 		return $GLOBALS['emoji_maps']['names'][$unified_cp] ? $GLOBALS['emoji_maps']['names'][$unified_cp] : '?';
3544 3544
 	}
3545 3545
 	
Please login to merge, or discard this patch.
src/LaravelEmoji.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,9 +8,9 @@
 block discarded – undo
8 8
 
9 9
 	static public function covertEmojiToName($data) {
10 10
 		$data = emoji_docomo_to_unified($data);   # DoCoMo devices
11
-	    $data = emoji_kddi_to_unified($data);     # KDDI & Au devices
12
-    	$data = emoji_softbank_to_unified($data); # Softbank & (iPhone) Apple devices
13
-	    $data = emoji_google_to_unified($data);   # Google Android devices
11
+		$data = emoji_kddi_to_unified($data);     # KDDI & Au devices
12
+		$data = emoji_softbank_to_unified($data); # Softbank & (iPhone) Apple devices
13
+		$data = emoji_google_to_unified($data);   # Google Android devices
14 14
 		$data = emoji_unified_to_name($data);
15 15
 		$data = emoji_unified_to_key($data);
16 16
 		return $data;
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -7,10 +7,10 @@  discard block
 block discarded – undo
7 7
 class LaravelEmoji extends Controller {
8 8
 
9 9
 	static public function covertEmojiToName($data) {
10
-		$data = emoji_docomo_to_unified($data);   # DoCoMo devices
11
-	    $data = emoji_kddi_to_unified($data);     # KDDI & Au devices
10
+		$data = emoji_docomo_to_unified($data); # DoCoMo devices
11
+	    $data = emoji_kddi_to_unified($data); # KDDI & Au devices
12 12
     	$data = emoji_softbank_to_unified($data); # Softbank & (iPhone) Apple devices
13
-	    $data = emoji_google_to_unified($data);   # Google Android devices
13
+	    $data = emoji_google_to_unified($data); # Google Android devices
14 14
 		$data = emoji_unified_to_name($data);
15 15
 		$data = emoji_unified_to_key($data);
16 16
 		return $data;
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	}
47 47
 
48 48
 	static public function textWithEmoji($data) {
49
-		if($data=="") return false;
49
+		if ($data == "") return false;
50 50
 
51 51
 		$data = LaravelEmoji::covertEmojiToName($data);
52 52
 		$data = LaravelEmoji::covertNameToEmoji($data);
@@ -56,29 +56,29 @@  discard block
 block discarded – undo
56 56
 		$n = 0;
57 57
 
58 58
 		$strLen = mb_strlen($data, 'UTF-8');
59
-		for($i=0; $i<$strLen; $i++) {
59
+		for ($i = 0; $i < $strLen; $i++) {
60 60
 			$char = mb_substr($data, $i, 1, 'UTF-8');
61 61
 			$charCode = LaravelEmoji::uniChrCode($char);
62 62
 
63
-			if($charCode>1000) {				
63
+			if ($charCode > 1000) {				
64 64
 
65 65
 				if ($haut != 0) {
66
-					if (0xDC00 <= $charCode&& $charCode<= 0xDFFF) {
67
-						$CPString .= ' imgFront'. strtolower(dechex(0x10000 + (($haut - 0xD800) << 10) + ($charCode  - 0xDC00))) . 'imgBack ';
66
+					if (0xDC00 <= $charCode && $charCode <= 0xDFFF) {
67
+						$CPString .= ' imgFront' . strtolower(dechex(0x10000 + (($haut - 0xD800) << 10) + ($charCode - 0xDC00))) . 'imgBack ';
68 68
 						$haut = 0;
69 69
 						continue;
70 70
 					}
71 71
 					else {
72
-						$CPString .=  'Error2' . strtolower(dechex($haut)) . '!';
72
+						$CPString .= 'Error2' . strtolower(dechex($haut)) . '!';
73 73
 						$haut = 0;
74 74
 					}
75 75
 				}
76 76
 
77
-				if (0xD800 <= $charCode  && $charCode <= 0xDBFF) {
77
+				if (0xD800 <= $charCode && $charCode <= 0xDBFF) {
78 78
 					$haut = $charCode;
79 79
 				}
80 80
 				else {
81
-					$CPString .= ' imgFront'. strtolower(dechex($charCode)) . 'imgBack ';
81
+					$CPString .= ' imgFront' . strtolower(dechex($charCode)) . 'imgBack ';
82 82
 				}
83 83
 			}
84 84
 			else {
Please login to merge, or discard this patch.