Passed
Push — master ( 60b368...2c948e )
by ma
01:44
created
src/File.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         //内容写入文件
63 63
         if($file_append === false){
64 64
             file_put_contents($file_name,$content);
65
-        }else{
65
+        } else{
66 66
             file_put_contents($file_name,$content,FILE_APPEND);
67 67
         }
68 68
     }
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             $handle = fopen($file_name, 'w');
93 93
             fwrite($handle, $content);
94 94
             fclose($handle);
95
-        }else{
95
+        } else{
96 96
             $handle = fopen($file_name, 'a');
97 97
             fwrite($handle, $content);
98 98
             fclose($handle);
Please login to merge, or discard this patch.
src/Strings.php 1 patch
Braces   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         if(empty($time)){
76 76
             list($msec, $sec) = explode(' ', microtime());
77 77
             $millisecond = (int)sprintf('%.0f', (floatval($msec) + floatval($sec)) * 1000);
78
-        }else{
78
+        } else{
79 79
             $millisecond = strtotime($time)."000";
80 80
         }
81 81
         return (int)$millisecond;
@@ -160,12 +160,12 @@  discard block
 block discarded – undo
160 160
             foreach ($string as $key => $val) {
161 161
                 $_key = self::autoCharset($key, $from, $to);
162 162
                 $string[$_key] = self::autoCharset($val, $from, $to);
163
-                if ($key != $_key)
164
-                    unset($string[$key]);
163
+                if ($key != $_key) {
164
+                                    unset($string[$key]);
165
+                }
165 166
             }
166 167
             return $string;
167
-        }
168
-        else {
168
+        } else {
169 169
             return $string;
170 170
         }
171 171
     }
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
     public static function getTime($date,$is_timestamp=false):string {
204 204
         if($is_timestamp == true){
205 205
             $time = $date;
206
-        }else{
206
+        } else{
207 207
             $time = strtotime($date);//时间转换为时间戳
208 208
         }
209 209
 
Please login to merge, or discard this patch.
src/Tool.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,11 +37,11 @@  discard block
 block discarded – undo
37 37
     public static function getIp(){
38 38
         if(!empty($_SERVER["HTTP_CLIENT_IP"])){
39 39
             $cip = $_SERVER["HTTP_CLIENT_IP"];
40
-        }else if(!empty($_SERVER["HTTP_X_FORWARDED_FOR"])){
40
+        } else if(!empty($_SERVER["HTTP_X_FORWARDED_FOR"])){
41 41
             $cip = $_SERVER["HTTP_X_FORWARDED_FOR"];
42
-        }else if(!empty($_SERVER["REMOTE_ADDR"])){
42
+        } else if(!empty($_SERVER["REMOTE_ADDR"])){
43 43
             $cip = $_SERVER["REMOTE_ADDR"];
44
-        }else{
44
+        } else{
45 45
             $cip = '';
46 46
         }
47 47
         preg_match("/[\d\.]{7,15}/", $cip, $cips);
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
             if(is_array($val)){
172 172
                 if(empty($val)){
173 173
                     settype($val,'object');
174
-                }else{
174
+                } else{
175 175
                     self::nullArrayToObject($val);
176 176
                 }
177 177
             }
Please login to merge, or discard this patch.
src/exception/TinymengException.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,9 @@
 block discarded – undo
21 21
         $this->headers    = $headers;
22 22
 
23 23
         /** message */
24
-        if(empty($message)) $message = isset(StatusCode::$status_code[$statusCode]) ? StatusCode::$status_code[$statusCode] :StatusCode::$status_code[StatusCode::COMMON_UNKNOWN];
24
+        if(empty($message)) {
25
+            $message = isset(StatusCode::$status_code[$statusCode]) ? StatusCode::$status_code[$statusCode] :StatusCode::$status_code[StatusCode::COMMON_UNKNOWN];
26
+        }
25 27
         parent::__construct('ERROR_TINYMENG_TOOL: '.$message, $code, $previous);
26 28
     }
27 29
 
Please login to merge, or discard this patch.
src/Encryption.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 
38 38
         if($operation == 'decode'){
39 39
             $string = base64_decode(substr($string, $ckey_length));
40
-        }else{
40
+        } else{
41 41
             $a = $expiry ? $expiry + time() : 0;
42 42
             $string = sprintf('%010d', $a).substr(md5($string.$keyb), 0, 16).$string;
43 43
         }
Please login to merge, or discard this patch.
src/HttpRequest.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -101,14 +101,14 @@  discard block
 block discarded – undo
101 101
                 throw new TinymengException(StatusCode::COMMON_TINYMENG_REQUEST_METHOD,
102 102
                     '[httpPost]: POST request was aborted ! Request url :' . $url . ' , post request data : ' . var_export($param,true)
103 103
                 );
104
-            }elseif(intval($info["http_code"]) != $http_code){
104
+            } elseif(intval($info["http_code"]) != $http_code){
105 105
                 throw new TinymengException(StatusCode::COMMON_TINYMENG_REQUEST_METHOD,
106 106
                     '[httpPost]: POST request was aborted ! Request url :' . $url . ' , post request data : ' . var_export($param,true).' ,return code : '.$info["http_code"] .' ,return content : '.$content
107 107
                 );
108 108
             } else {
109 109
                 return $content;
110 110
             }
111
-        }else{
111
+        } else{
112 112
             return $content;
113 113
         }
114 114
     }
@@ -179,14 +179,14 @@  discard block
 block discarded – undo
179 179
                 throw new TinymengException(StatusCode::COMMON_TINYMENG_REQUEST_METHOD,
180 180
                     '[httpGet]: GET request was aborted ! Request url :' . $url
181 181
                 );
182
-            }elseif(intval($info["http_code"]) != $http_code){
182
+            } elseif(intval($info["http_code"]) != $http_code){
183 183
                 throw new TinymengException(StatusCode::COMMON_TINYMENG_REQUEST_METHOD,
184 184
                     '[httpGet]: GET request was aborted ! Request url :' . $url .' ,return code : '.$info["http_code"] .' ,return content : '.$content
185 185
                 );
186 186
             } else {
187 187
                 return $content;
188 188
             }
189
-        }else{
189
+        } else{
190 190
             return $content;
191 191
         }
192 192
     }
Please login to merge, or discard this patch.