@@ -240,7 +240,7 @@ |
||
| 240 | 240 | |
| 241 | 241 | /** |
| 242 | 242 | * get keypic token hidden field text |
| 243 | - * @return boolean|string |
|
| 243 | + * @return string|false |
|
| 244 | 244 | */ |
| 245 | 245 | public function getTokenInput() |
| 246 | 246 | { |
@@ -377,12 +377,12 @@ |
||
| 377 | 377 | "http://".$this->host, |
| 378 | 378 | ['headers' => ['content-type' => 'application/x-www-form-urlencoded', |
| 379 | 379 | 'User-Agent' => $this->UserAgent], |
| 380 | - 'body' => $fields, |
|
| 381 | - 'version' => 1.0 |
|
| 382 | - ] |
|
| 380 | + 'body' => $fields, |
|
| 381 | + 'version' => 1.0 |
|
| 382 | + ] |
|
| 383 | 383 | ); |
| 384 | 384 | |
| 385 | - $result = $response->getBody()->getContents(); |
|
| 385 | + $result = $response->getBody()->getContents(); |
|
| 386 | 386 | |
| 387 | 387 | if (empty($result) !== true) { |
| 388 | 388 | return json_decode($result, true); |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | { |
| 79 | 79 | $this->request = $request; |
| 80 | 80 | $this->version = $vesion; |
| 81 | - $this->UserAgent = 'Keypic PHP Class, Version: '.$this->version; |
|
| 81 | + $this->UserAgent = 'Keypic PHP Class, Version: ' . $this->version; |
|
| 82 | 82 | $this->host = 'ws.keypic.com'; |
| 83 | 83 | } |
| 84 | 84 | |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | $this->Token = $response['Token']; |
| 231 | 231 | return $response['Token']; |
| 232 | 232 | } elseif ($response['status'] == 'error') { |
| 233 | - throw new \Exception("Keypic error generation, ".$response['error']); |
|
| 233 | + throw new \Exception("Keypic error generation, " . $response['error']); |
|
| 234 | 234 | } |
| 235 | 235 | } |
| 236 | 236 | |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | public function getTokenInput() |
| 246 | 246 | { |
| 247 | 247 | if ($this->Token) { |
| 248 | - return '<input type="hidden" name="'.$this->TokenInputName.'" value="' . $this->Token . '" />'; |
|
| 248 | + return '<input type="hidden" name="' . $this->TokenInputName . '" value="' . $this->Token . '" />'; |
|
| 249 | 249 | } |
| 250 | 250 | return false; |
| 251 | 251 | } |
@@ -262,25 +262,25 @@ discard block |
||
| 262 | 262 | if ($this->Token) { |
| 263 | 263 | switch ($RequestType) { |
| 264 | 264 | case 'getImage': |
| 265 | - $ret = '<a href="http://' . $this->host . '/?RequestType=getClick&Token=' . |
|
| 265 | + $ret = '<a href="http://' . $this->host . '/?RequestType=getClick&Token=' . |
|
| 266 | 266 | $this->Token . '" target="_blank"><img src="//' . $this->host |
| 267 | 267 | . '/?RequestType=getImage&Token=' . $this->Token |
| 268 | - . '&WidthHeight=' . $WidthHeight . '&Debug='.$this->Debug |
|
| 268 | + . '&WidthHeight=' . $WidthHeight . '&Debug=' . $this->Debug |
|
| 269 | 269 | . '&PublisherID=' . $this->PublisherID |
| 270 | 270 | . '" alt="Form protected by Keypic" /></a>'; |
| 271 | 271 | break; |
| 272 | 272 | |
| 273 | 273 | default: |
| 274 | - $ret = '<script type="text/javascript" src="//' . $this->host . |
|
| 274 | + $ret = '<script type="text/javascript" src="//' . $this->host . |
|
| 275 | 275 | '/?RequestType=getScript&Token=' . $this->Token |
| 276 | - . '&WidthHeight=' . $WidthHeight . '&Debug='.$this->Debug |
|
| 276 | + . '&WidthHeight=' . $WidthHeight . '&Debug=' . $this->Debug |
|
| 277 | 277 | . '&PublisherID=' . $this->PublisherID . '"></script>'; |
| 278 | 278 | break; |
| 279 | 279 | } |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | if (empty($ret) === true) { |
| 283 | - $ret = '<a href="http://keypic.com" target="_blank">'. |
|
| 283 | + $ret = '<a href="http://keypic.com" target="_blank">' . |
|
| 284 | 284 | 'Incorrect keypic configuration</a>'; |
| 285 | 285 | } |
| 286 | 286 | |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | */ |
| 296 | 296 | public function renderHtml($RequestType = 'getScript', $WidthHeight = '336x280') |
| 297 | 297 | { |
| 298 | - return $this->getTokenInput().$this->getIt($RequestType, $WidthHeight); |
|
| 298 | + return $this->getTokenInput() . $this->getIt($RequestType, $WidthHeight); |
|
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | /** |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | if ($response['status'] == 'response') { |
| 332 | 332 | return $response['spam']; |
| 333 | 333 | } elseif ($response['status'] == 'error') { |
| 334 | - throw new \Exception("Error validating keypic token, error: ".$response['error']); |
|
| 334 | + throw new \Exception("Error validating keypic token, error: " . $response['error']); |
|
| 335 | 335 | } |
| 336 | 336 | } else { |
| 337 | 337 | throw new \Exception("Empty keypic token or Form ID"); |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | { |
| 375 | 375 | $client = new \GuzzleHttp\Client(['timeout'=>3]); |
| 376 | 376 | $response = $client->post( |
| 377 | - "http://".$this->host, |
|
| 377 | + "http://" . $this->host, |
|
| 378 | 378 | ['headers' => ['content-type' => 'application/x-www-form-urlencoded', |
| 379 | 379 | 'User-Agent' => $this->UserAgent], |
| 380 | 380 | 'body' => $fields, |