@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | * |
| 66 | 66 | * @return array |
| 67 | 67 | */ |
| 68 | - public function createIndex($params = []) |
|
| 68 | + public function createIndex($params = [ ]) |
|
| 69 | 69 | { |
| 70 | 70 | return $this->client->indices()->create($this->mergeParams($params)); |
| 71 | 71 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | * |
| 78 | 78 | * @return array |
| 79 | 79 | */ |
| 80 | - public function dropIndex($params = []) |
|
| 80 | + public function dropIndex($params = [ ]) |
|
| 81 | 81 | { |
| 82 | 82 | return $this->client->indices()->delete($this->mergeParams($params)); |
| 83 | 83 | } |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | { |
| 18 | 18 | $query = self::buildQuery($params); |
| 19 | 19 | |
| 20 | - if(isset($object)) |
|
| 20 | + if (isset($object)) |
|
| 21 | 21 | { |
| 22 | 22 | $query = static::addType($object) + $query; |
| 23 | 23 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | 'query' => $params |
| 39 | 39 | ] |
| 40 | 40 | ]; |
| 41 | - if(isset($object)) |
|
| 41 | + if (isset($object)) |
|
| 42 | 42 | { |
| 43 | 43 | $query = static::addType($object) + $query; |
| 44 | 44 | } |
@@ -67,13 +67,13 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | protected static function addType($object) |
| 69 | 69 | { |
| 70 | - if(is_object($object)){ |
|
| 70 | + if (is_object($object)) { |
|
| 71 | 71 | $type = static::checkValidEloquent($object); |
| 72 | 72 | } |
| 73 | - else{ |
|
| 73 | + else { |
|
| 74 | 74 | $type = (new $object)->getTable(); |
| 75 | 75 | } |
| 76 | - return ["type"=>$type]; |
|
| 76 | + return [ "type"=>$type ]; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | /** |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | { |
| 67 | 67 | $password = str_random(7); |
| 68 | 68 | $input = $this->ask('For safety please enter this text "'.$password.'"'); |
| 69 | - if($input == $password){ |
|
| 69 | + if ($input == $password) { |
|
| 70 | 70 | return $this->buildIndex(); |
| 71 | 71 | } |
| 72 | 72 | else { |
@@ -86,11 +86,11 @@ discard block |
||
| 86 | 86 | $this->client->dropIndex(); |
| 87 | 87 | $response = $this->client->createIndex($this->params); |
| 88 | 88 | |
| 89 | - if(is_array($response) && $response['acknowledged'] == true) |
|
| 89 | + if (is_array($response) && $response[ 'acknowledged' ] == true) |
|
| 90 | 90 | { |
| 91 | 91 | $this->info('Index Initialization Successful'); |
| 92 | 92 | } |
| 93 | - else{ |
|
| 93 | + else { |
|
| 94 | 94 | $this->error('Index Initialization Failed'); |
| 95 | 95 | } |
| 96 | 96 | } |