@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | if($error instanceof \Exception){ |
22 | 22 | $e = $error; |
23 | 23 | $message = "exception '".get_class($error)."' with message {$error->getMessage()}"; |
24 | - }else{ |
|
24 | + } else{ |
|
25 | 25 | $e = new \RuntimeException($error); |
26 | 26 | $message = $error; |
27 | 27 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | if($e->getFile() == __FILE__){ |
31 | 31 | $file = $trace[0]['file']; |
32 | 32 | $line = $trace[0]['line']; |
33 | - }else{ |
|
33 | + } else{ |
|
34 | 34 | $file = $e->getFile(); |
35 | 35 | $line = $e->getLine(); |
36 | 36 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | { |
54 | 54 | if(is_object($entity)){ |
55 | 55 | return $db->getApp()->make(ModelWithObject::class, ['db'=>$db, 'entity'=>$entity]); |
56 | - }else{ |
|
56 | + } else{ |
|
57 | 57 | return $db->getApp()->make(ModelWithClass::class, ['db'=>$db, 'entityName'=>$entity]); |
58 | 58 | } |
59 | 59 | } |
@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | public function appendSql($sql, $addSpace=true){ |
18 | 18 | if($this->sql == ''){ |
19 | 19 | $this->sql = $sql; |
20 | - }else{ |
|
20 | + } else{ |
|
21 | 21 | if($addSpace){ |
22 | 22 | $this->sql = $this->sql.' '.$sql; |
23 | - }else{ |
|
23 | + } else{ |
|
24 | 24 | $this->sql = $this->sql.$sql; |
25 | 25 | } |
26 | 26 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | { |
38 | 38 | if($resultHandler = $this->resultHandler){ |
39 | 39 | return $resultHandler($result); |
40 | - }else{ |
|
40 | + } else{ |
|
41 | 41 | return $result; |
42 | 42 | } |
43 | 43 | } |
@@ -63,7 +63,7 @@ |
||
63 | 63 | if($pos !== false){ |
64 | 64 | $this->snippets[$ori] = substr($str, $ori, $pos-$ori); |
65 | 65 | $pos ++; |
66 | - }else{ |
|
66 | + } else{ |
|
67 | 67 | $this->snippets[$ori] = substr($str, $ori); |
68 | 68 | } |
69 | 69 | return $pos; |
@@ -100,9 +100,9 @@ |
||
100 | 100 | $obj = new SelectRule(new Context($this->connection)); |
101 | 101 | if($column0 == null){ |
102 | 102 | $args = ['*']; |
103 | - }elseif(is_array($column0)){ |
|
103 | + } elseif(is_array($column0)){ |
|
104 | 104 | $args = $column0; |
105 | - }else{ |
|
105 | + } else{ |
|
106 | 106 | $args = func_get_args(); |
107 | 107 | } |
108 | 108 | foreach ($args as &$arg){ |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $this->threads[] = function ()use($thread, $pos){ |
20 | 20 | try{ |
21 | 21 | $this->threadResults[$pos][0] = $thread(); |
22 | - }catch (\Exception $e){ |
|
22 | + } catch (\Exception $e){ |
|
23 | 23 | $this->threadResults[$pos][1] = $e; |
24 | 24 | } |
25 | 25 | }; |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $res = array_pop($this->waitResults); |
56 | 56 | if(isset($res[1])){ |
57 | 57 | \PhpBoot\abort(new RpcException($res['reason'])); |
58 | - }else{ |
|
58 | + } else{ |
|
59 | 59 | return $res[0]; |
60 | 60 | } |
61 | 61 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $op = $this->http->sendAsync($request); |
53 | 53 | $res = MultiRpc::wait($op); |
54 | 54 | return $this->mapResponse($method, $route, $res, $args); |
55 | - }else{ |
|
55 | + } else{ |
|
56 | 56 | $res = $this->http->send($request); |
57 | 57 | return $this->mapResponse($method, $route, $res, $args); |
58 | 58 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $query[$k] = $v; |
134 | 134 | } |
135 | 135 | } |
136 | - }else{ |
|
136 | + } else{ |
|
137 | 137 | foreach ($request as $k => $v){ |
138 | 138 | if(!in_array($k, ['query', 'request', 'files', 'cookies', 'headers'])){ |
139 | 139 | if($body === null){ |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | ArrayHelper::set($mapping, $return->source, $data); |
206 | 206 | } |
207 | 207 | |
208 | - }else{ |
|
208 | + } else{ |
|
209 | 209 | |
210 | 210 | //TODO 如果多个 异常对应同一个 statusCode 怎么处理 |
211 | 211 | $exceptions = $route->getExceptionHandler()->getExceptions(); |
@@ -26,7 +26,7 @@ |
||
26 | 26 | foreach (Promise\settle($promises)->wait() as $i){ |
27 | 27 | if(isset($i['reason'])){ |
28 | 28 | $res[] = [null, new RpcException($i['reason'])]; |
29 | - }else{ |
|
29 | + } else{ |
|
30 | 30 | $res[] = [$i['value'], null]; |
31 | 31 | } |
32 | 32 | } |
@@ -213,9 +213,9 @@ discard block |
||
213 | 213 | { |
214 | 214 | if ($content instanceof ReturnMeta || $content instanceof ParamMeta) { |
215 | 215 | return $this->makeExample($content->container); |
216 | - }elseif ($content instanceof TypeContainerInterface){ |
|
216 | + } elseif ($content instanceof TypeContainerInterface){ |
|
217 | 217 | return $content->makeExample(); |
218 | - }elseif(is_array($content)) { |
|
218 | + } elseif(is_array($content)) { |
|
219 | 219 | $res = []; |
220 | 220 | foreach ($content as $k => $v) { |
221 | 221 | $res[$k] = $this->makeExample($v); |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | $paramSchema = new PrimitiveSchemaObject(); |
371 | 371 | if($isFile){ |
372 | 372 | $paramSchema->type = 'file'; |
373 | - }else{ |
|
373 | + } else{ |
|
374 | 374 | $paramSchema->type = self::mapType($param->type); |
375 | 375 | self::mapValidation($param->validation, $paramSchema); |
376 | 376 | } |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | } elseif($container == null){ |
429 | 429 | $schema = null ;//new PrimitiveSchemaObject(); |
430 | 430 | //$schema->type = null; |
431 | - }else { |
|
431 | + } else { |
|
432 | 432 | $schema = new PrimitiveSchemaObject(); |
433 | 433 | //$schema->type = 'mixed'; |
434 | 434 | } |
@@ -23,11 +23,11 @@ |
||
23 | 23 | $value = json_encode($value, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); |
24 | 24 | //} |
25 | 25 | $response->setContent($value); |
26 | - }elseif($key == 'headers'){ |
|
26 | + } elseif($key == 'headers'){ |
|
27 | 27 | foreach ($value as $k=>$v){ |
28 | 28 | $response->headers->set($k, $v); |
29 | 29 | } |
30 | - }else{ |
|
30 | + } else{ |
|
31 | 31 | \PhpBoot\abort(new \UnexpectedValueException("Unexpected output target $key")); |
32 | 32 | } |
33 | 33 |