@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace JanDrda\LaravelGoogleCustomSearchEngine; |
4 | 4 | |
5 | 5 | use Exception; |
6 | -use JanDrda\LaravelGoogleCustomeSearchEngine\Interfaces\LaravelGoogleCustomSearchEngineInterface; |
|
7 | 6 | |
8 | 7 | class LaravelGoogleCustomSearchEngine |
9 | 8 | { |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * |
48 | 48 | * @param $engineId |
49 | 49 | */ |
50 | - public function setEngineId($engineId){ |
|
50 | + public function setEngineId($engineId) { |
|
51 | 51 | $this->engineId = $engineId; |
52 | 52 | } |
53 | 53 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * |
57 | 57 | * @param $engineId |
58 | 58 | */ |
59 | - public function setApiKey($apiKey){ |
|
59 | + public function setApiKey($apiKey) { |
|
60 | 60 | $this->apiKey = $apiKey; |
61 | 61 | } |
62 | 62 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | */ |
138 | 138 | if ($output === false || $info['http_code'] != 200) { |
139 | 139 | |
140 | - throw new \Exception("No data returned, code [". $info['http_code']. "] - " . curl_error($ch)); |
|
140 | + throw new \Exception("No data returned, code [" . $info['http_code'] . "] - " . curl_error($ch)); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | /** |
@@ -148,10 +148,10 @@ discard block |
||
148 | 148 | /** |
149 | 149 | * If there are some results, return them, otherwise return blank array |
150 | 150 | */ |
151 | - if(isset($this->originalResponse->items)){ |
|
151 | + if (isset($this->originalResponse->items)) { |
|
152 | 152 | return $this->originalResponse->items; |
153 | 153 | } |
154 | - else{ |
|
154 | + else { |
|
155 | 155 | return array(); |
156 | 156 | } |
157 | 157 | |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | * @return \stdClass |
169 | 169 | * @url https://developers.google.com/custom-search/json-api/v1/reference/cse/list#response |
170 | 170 | */ |
171 | - public function getRawResult(){ |
|
171 | + public function getRawResult() { |
|
172 | 172 | return $this->originalResponse; |
173 | 173 | } |
174 | 174 | |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | * |
184 | 184 | * @return \stdClass |
185 | 185 | */ |
186 | - public function getSearchInformation(){ |
|
186 | + public function getSearchInformation() { |
|
187 | 187 | return $this->originalResponse->searchInformation; |
188 | 188 | } |
189 | 189 | |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | * |
193 | 193 | * @return integer |
194 | 194 | */ |
195 | - public function getTotalNumberOfpages(){ |
|
195 | + public function getTotalNumberOfpages() { |
|
196 | 196 | return $this->originalResponse->searchInformation->totalResults; |
197 | 197 | } |
198 | 198 |
@@ -150,8 +150,7 @@ |
||
150 | 150 | */ |
151 | 151 | if(isset($this->originalResponse->items)){ |
152 | 152 | return $this->originalResponse->items; |
153 | - } |
|
154 | - else{ |
|
153 | + } else{ |
|
155 | 154 | return array(); |
156 | 155 | } |
157 | 156 |
@@ -9,13 +9,13 @@ |
||
9 | 9 | public function boot() |
10 | 10 | { |
11 | 11 | $this->publishes([ |
12 | - __DIR__.'/../../config/laravelGoogleCustomSearchEngine.php' => config_path('laravelGoogleCustomSearchEngine.php'), |
|
12 | + __DIR__ . '/../../config/laravelGoogleCustomSearchEngine.php' => config_path('laravelGoogleCustomSearchEngine.php'), |
|
13 | 13 | ]); |
14 | 14 | } |
15 | 15 | |
16 | 16 | public function register() |
17 | 17 | { |
18 | - $this->app->bind('laravelGoogleCustomSearchEngine', function () { |
|
18 | + $this->app->bind('laravelGoogleCustomSearchEngine', function() { |
|
19 | 19 | |
20 | 20 | return new LaravelGoogleCustomSearchEngine(config('laravelGoogleCustomSearchEngine.engineId'), |
21 | 21 | config('laravelGoogleCustomSearchEngine.apiKey')); |