Completed
Push — master ( 1c4bc2...43599e )
by Bahri Meriç
04:12 queued 01:44
created
src/LaravelEmoji.php 4 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -40,6 +40,9 @@
 block discarded – undo
40 40
  	   return mb_convert_encoding('&#' . intval($u) . ';', 'UTF-8', 'HTML-ENTITIES');
41 41
 	}
42 42
 
43
+	/**
44
+	 * @param string $data
45
+	 */
43 46
 	static private function uniChrCode($data) {
44 47
 	   list(, $ord) = unpack('N', mb_convert_encoding($data, 'UCS-4BE', 'UTF-8'));
45 48
 	   return $ord;
Please login to merge, or discard this patch.
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,11 +56,11 @@  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 ( $charCode < 0 || $charCode > 0xFFFF ) {
66 66
 					$CPString .= 'Error1 ' . strtolower(dechex($charCode)) . '!';
@@ -68,22 +68,22 @@  discard block
 block discarded – undo
68 68
 
69 69
 
70 70
 				if ($haut != 0) {
71
-					if (0xDC00 <= $charCode&& $charCode<= 0xDFFF) {
72
-						$CPString .= ' imgFront'. strtolower(dechex(0x10000 + (($haut - 0xD800) << 10) + ($charCode  - 0xDC00))) . 'imgBack ';
71
+					if (0xDC00 <= $charCode && $charCode <= 0xDFFF) {
72
+						$CPString .= ' imgFront' . strtolower(dechex(0x10000 + (($haut - 0xD800) << 10) + ($charCode - 0xDC00))) . 'imgBack ';
73 73
 						$haut = 0;
74 74
 						continue;
75 75
 					}
76 76
 					else {
77
-						$CPString .=  'Error2' . strtolower(dechex($haut)) . '!';
77
+						$CPString .= 'Error2' . strtolower(dechex($haut)) . '!';
78 78
 						$haut = 0;
79 79
 					}
80 80
 				}
81 81
 
82
-				if (0xD800 <= $charCode  && $charCode <= 0xDBFF) {
82
+				if (0xD800 <= $charCode && $charCode <= 0xDBFF) {
83 83
 					$haut = $charCode;
84 84
 				}
85 85
 				else {
86
-					$CPString .= ' imgFront'. strtolower(dechex($charCode)) . 'imgBack ';
86
+					$CPString .= ' imgFront' . strtolower(dechex($charCode)) . 'imgBack ';
87 87
 				}
88 88
 			}
89 89
 			else {
Please login to merge, or discard this patch.
Braces   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -46,7 +46,9 @@  discard block
 block discarded – undo
46 46
 	}
47 47
 
48 48
 	static public function textWithEmoji($data) {
49
-		if($data=="") return false;
49
+		if($data=="") {
50
+			return false;
51
+		}
50 52
 
51 53
 		$data = LaravelEmoji::covertEmojiToName($data);
52 54
 		$data = LaravelEmoji::covertNameToEmoji($data);
@@ -72,8 +74,7 @@  discard block
 block discarded – undo
72 74
 						$CPString .= ' imgFront'. strtolower(dechex(0x10000 + (($haut - 0xD800) << 10) + ($charCode  - 0xDC00))) . 'imgBack ';
73 75
 						$haut = 0;
74 76
 						continue;
75
-					}
76
-					else {
77
+					} else {
77 78
 						$CPString .=  'Error2' . strtolower(dechex($haut)) . '!';
78 79
 						$haut = 0;
79 80
 					}
@@ -81,12 +82,10 @@  discard block
 block discarded – undo
81 82
 
82 83
 				if (0xD800 <= $charCode  && $charCode <= 0xDBFF) {
83 84
 					$haut = $charCode;
84
-				}
85
-				else {
85
+				} else {
86 86
 					$CPString .= ' imgFront'. strtolower(dechex($charCode)) . 'imgBack ';
87 87
 				}
88
-			}
89
-			else {
88
+			} else {
90 89
 				$CPString .= LaravelEmoji::uniChr($charCode);
91 90
 			}
92 91
 		}
Please login to merge, or discard this patch.
src/LaravelEmojiServiceProvider.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -6,23 +6,23 @@
 block discarded – undo
6 6
 
7 7
 class LaravelEmojiServiceProvider extends ServiceProvider
8 8
 {
9
-    /**
10
-     * Bootstrap the application services.
11
-     *
12
-     * @return void
13
-     */
14
-    public function boot()
15
-    {
9
+	/**
10
+	 * Bootstrap the application services.
11
+	 *
12
+	 * @return void
13
+	 */
14
+	public function boot()
15
+	{
16 16
 	//
17
-    }
17
+	}
18 18
 
19
-    /**
20
-     * Register the application services.
21
-     *
22
-     * @return void
23
-     */
24
-    public function register()
25
-    {
26
-        //
27
-    }
19
+	/**
20
+	 * Register the application services.
21
+	 *
22
+	 * @return void
23
+	 */
24
+	public function register()
25
+	{
26
+		//
27
+	}
28 28
 }
Please login to merge, or discard this patch.
src/Emoji.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -9901,31 +9901,31 @@
 block discarded – undo
9901 9901
 	# functions to convert incoming data into the unified format
9902 9902
 	#
9903 9903
 
9904
-	function emoji_docomo_to_unified(	$text){ return emoji_convert($text, 'docomo_to_unified'); }
9905
-	function emoji_kddi_to_unified(		$text){ return emoji_convert($text, 'kddi_to_unified'); }
9906
-	function emoji_softbank_to_unified(	$text){ return emoji_convert($text, 'softbank_to_unified'); }
9907
-	function emoji_google_to_unified(	$text){ return emoji_convert($text, 'google_to_unified'); }
9904
+	function emoji_docomo_to_unified($text) { return emoji_convert($text, 'docomo_to_unified'); }
9905
+	function emoji_kddi_to_unified($text) { return emoji_convert($text, 'kddi_to_unified'); }
9906
+	function emoji_softbank_to_unified($text) { return emoji_convert($text, 'softbank_to_unified'); }
9907
+	function emoji_google_to_unified($text) { return emoji_convert($text, 'google_to_unified'); }
9908 9908
 
9909 9909
 
9910 9910
 	#
9911 9911
 	# functions to convert unified data into an outgoing format
9912 9912
 	#
9913 9913
 
9914
-	function emoji_unified_to_docomo(	$text){ return emoji_convert($text, 'unified_to_docomo'); }
9915
-	function emoji_unified_to_kddi(		$text){ return emoji_convert($text, 'unified_to_kddi'); }
9916
-	function emoji_unified_to_softbank(	$text){ return emoji_convert($text, 'unified_to_softbank'); }
9917
-	function emoji_unified_to_google(	$text){ return emoji_convert($text, 'unified_to_google'); }
9918
-	function emoji_unified_to_html(		$text){ return emoji_convert($text, 'unified_to_html'); }
9919
-	function emoji_html_to_unified(		$text){ return emoji_convert($text, 'html_to_unified'); }
9914
+	function emoji_unified_to_docomo($text) { return emoji_convert($text, 'unified_to_docomo'); }
9915
+	function emoji_unified_to_kddi($text) { return emoji_convert($text, 'unified_to_kddi'); }
9916
+	function emoji_unified_to_softbank($text) { return emoji_convert($text, 'unified_to_softbank'); }
9917
+	function emoji_unified_to_google($text) { return emoji_convert($text, 'unified_to_google'); }
9918
+	function emoji_unified_to_html($text) { return emoji_convert($text, 'unified_to_html'); }
9919
+	function emoji_html_to_unified($text) { return emoji_convert($text, 'html_to_unified'); }
9920 9920
 
9921 9921
 
9922 9922
 
9923
-	function emoji_convert($text, $map){
9923
+	function emoji_convert($text, $map) {
9924 9924
 
9925 9925
 		return str_replace(array_keys($GLOBALS['emoji_maps'][$map]), $GLOBALS['emoji_maps'][$map], $text);
9926 9926
 	}
9927 9927
 
9928
-	function emoji_get_name($unified_cp){
9928
+	function emoji_get_name($unified_cp) {
9929 9929
 
9930 9930
 		return $GLOBALS['emoji_maps']['names'][$unified_cp] ? $GLOBALS['emoji_maps']['names'][$unified_cp] : '?';
9931 9931
 	}
Please login to merge, or discard this patch.