Test Failed
Push — master ( 37d3cb...34a83f )
by kill
03:43
created
core/helpers/Chaos.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -122,18 +122,18 @@  discard block
 block discarded – undo
122 122
 	 * @param string $str
123 123
 	 */
124 124
 	function setPinyin($str) {
125
-		$py = mt_rand(0, iconv_strlen( $str, 'UTF-8' )-1);
126
-		$t_str = iconv_substr( $str, $py, 1, 'UTF-8');
127
-		if(mt_rand(0,10) > 5) {
128
-		    $pinyin = " ";
125
+		$py=mt_rand(0, iconv_strlen($str, 'UTF-8') - 1);
126
+		$t_str=iconv_substr($str, $py, 1, 'UTF-8');
127
+		if (mt_rand(0, 10) > 5) {
128
+		    $pinyin=" ";
129 129
 		}
130
-		$pinyin = $this->_pinyin->convert($t_str,PINYIN_UNICODE);
131
-        $pinyin=implode(" ",$pinyin);
132
-		if(mt_rand(0,10) > 5) {
133
-		    $pinyin .= " ";
130
+		$pinyin=$this->_pinyin->convert($t_str, PINYIN_UNICODE);
131
+        $pinyin=implode(" ", $pinyin);
132
+		if (mt_rand(0, 10) > 5) {
133
+		    $pinyin.=" ";
134 134
 		}
135
-		if($t_str != "%"){
136
-			$str = preg_replace("'$t_str'", $pinyin, $str, 1);
135
+		if ($t_str != "%") {
136
+			$str=preg_replace("'$t_str'", $pinyin, $str, 1);
137 137
 		}
138 138
 		return $str;
139 139
 	}
@@ -144,18 +144,18 @@  discard block
 block discarded – undo
144 144
 	 * @param string $str
145 145
 	 */
146 146
 	function setRepeat($str) {
147
-		$len = iconv_strlen( $str, 'UTF-8' );
148
-		$action = 0;
149
-		$temp = '';
150
-		for( $i=0;  $i<$len; $i++ ){
151
-			$t_str = iconv_substr( $str, $i, 1 ,'UTF-8');
152
-			if( mt_rand( 1, 50 ) > 48 && $action == 0) {
153
-				if(!preg_match("@[a-z0-9%\\s]+@i", $t_str)) {
154
-					$temp .= $t_str;
155
-					$action = 1;
147
+		$len=iconv_strlen($str, 'UTF-8');
148
+		$action=0;
149
+		$temp='';
150
+		for ($i=0; $i < $len; $i++) {
151
+			$t_str=iconv_substr($str, $i, 1, 'UTF-8');
152
+			if (mt_rand(1, 50) > 48 && $action == 0) {
153
+				if (!preg_match("@[a-z0-9%\\s]+@i", $t_str)) {
154
+					$temp.=$t_str;
155
+					$action=1;
156 156
 				}
157 157
 			}
158
-			$temp .= $t_str;
158
+			$temp.=$t_str;
159 159
 		}
160 160
 		return $temp;
161 161
 	}
Please login to merge, or discard this patch.
core/App.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,12 +23,12 @@  discard block
 block discarded – undo
23 23
         $this->initContainer();
24 24
     }
25 25
 
26
-    private function initEnv(){
27
-        $dotEnv = new Dotenv($this->basePath);
26
+    private function initEnv() {
27
+        $dotEnv=new Dotenv($this->basePath);
28 28
         $dotEnv->load();
29 29
         date_default_timezone_set(env('APP_TIMEZONE', 'Asia/Shanghai'));
30 30
         define('IS_CLI', php_sapi_name() == 'cli');
31
-        if (env('DEBUG',false)) {
31
+        if (env('DEBUG', false)) {
32 32
             error_reporting(E_ALL);
33 33
             @ini_set('display_errors', 'On');
34 34
             //@ob_start();
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
      */
46 46
     private function initContainer() {
47 47
         static::setInstance($this);
48
-        $this->instance('app',$this);
49
-        $this->bind('pinyin','\puck\helpers\PinYin');
48
+        $this->instance('app', $this);
49
+        $this->bind('pinyin', '\puck\helpers\PinYin');
50 50
     }
51 51
 
52 52
 }
53 53
\ No newline at end of file
Please login to merge, or discard this patch.
function.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
 
409 409
     // 过滤查询特殊字符
410 410
     if (preg_match('/^(EXP|NEQ|GT|EGT|LT|ELT|OR|XOR|LIKE|NOTLIKE|NOT BETWEEN|NOTBETWEEN|BETWEEN|NOTIN|NOT IN|IN)$/i', $value)) {
411
-        $value .= ' ';
411
+        $value.=' ';
412 412
     }
413 413
 }
414 414
 /**
@@ -416,15 +416,15 @@  discard block
 block discarded – undo
416 416
  *
417 417
  * @return string|null
418 418
  */
419
-function config($name=null,$value=null,$default=null){
419
+function config($name=null, $value=null, $default=null) {
420 420
     $config=\puck\Conf::load();
421
-    if ($name===null){
421
+    if ($name === null) {
422 422
         return $config->all();
423 423
     }
424
-    if ($value===null){
425
-        return $config->get($name,$default);
424
+    if ($value === null) {
425
+        return $config->get($name, $default);
426 426
     }
427
-    $config->set($name,$value);
427
+    $config->set($name, $value);
428 428
 }
429 429
 /**
430 430
  * 字符串命名风格转换
@@ -441,14 +441,14 @@  discard block
 block discarded – undo
441 441
     }
442 442
 }
443 443
 
444
-if (! function_exists('app')) {
444
+if (!function_exists('app')) {
445 445
     /**
446 446
      * 获取容器实例
447 447
      *
448 448
      * @param  string  $make
449 449
      * @return mixed|\puck\App
450 450
      */
451
-    function app($make = null)
451
+    function app($make=null)
452 452
     {
453 453
         if (is_null($make)) {
454 454
             return Container::getInstance();
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
     }
458 458
 }
459 459
 
460
-if (! function_exists('env')) {
460
+if (!function_exists('env')) {
461 461
     /**
462 462
      * 获取环境变量
463 463
      *
@@ -465,9 +465,9 @@  discard block
 block discarded – undo
465 465
      * @param  mixed   $default
466 466
      * @return mixed
467 467
      */
468
-    function env($key, $default = null)
468
+    function env($key, $default=null)
469 469
     {
470
-        $value = getenv($key);
470
+        $value=getenv($key);
471 471
         if ($value === false) {
472 472
             return value($default);
473 473
         }
Please login to merge, or discard this patch.