Passed
Branch master (969cb7)
by Volodymyr
02:14
created
config/anticaptcha.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 return [
4
-	'key'=>env('ANTICAPTCHA_API_KEY','')
4
+	'key'=>env('ANTICAPTCHA_API_KEY', '')
5 5
 ];
6 6
\ No newline at end of file
Please login to merge, or discard this patch.
src/Anticaptcha/Anticaptcha.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -127,20 +127,20 @@
 block discarded – undo
127 127
         
128 128
         
129 129
         $ch = curl_init();
130
-        curl_setopt($ch,CURLOPT_URL,"{$this->scheme}://{$this->host}/$methodName");
131
-        curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
132
-        curl_setopt($ch,CURLOPT_ENCODING,"gzip,deflate");
133
-        curl_setopt($ch,CURLOPT_CUSTOMREQUEST, "POST");   
130
+        curl_setopt($ch, CURLOPT_URL, "{$this->scheme}://{$this->host}/$methodName");
131
+        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
132
+        curl_setopt($ch, CURLOPT_ENCODING, "gzip,deflate");
133
+        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");   
134 134
         $postDataEncoded = json_encode($postData);
135
-        curl_setopt($ch,CURLOPT_POSTFIELDS,$postDataEncoded);
136
-        curl_setopt($ch,CURLOPT_HTTPHEADER, array(
135
+        curl_setopt($ch, CURLOPT_POSTFIELDS, $postDataEncoded);
136
+        curl_setopt($ch, CURLOPT_HTTPHEADER, array(
137 137
             'Content-Type: application/json; charset=utf-8',     
138 138
             'Accept: application/json',     
139
-            'Content-Length: ' . strlen($postDataEncoded) 
139
+            'Content-Length: '.strlen($postDataEncoded) 
140 140
         ));
141
-        curl_setopt($ch,CURLOPT_TIMEOUT,30);
142
-        curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,30);
143
-        $result =curl_exec($ch);
141
+        curl_setopt($ch, CURLOPT_TIMEOUT, 30);
142
+        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
143
+        $result = curl_exec($ch);
144 144
         $curlError = curl_error($ch);
145 145
         
146 146
         if ($curlError != "") {
Please login to merge, or discard this patch.
src/examples/exampleGeetestTicketmaster.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -48,10 +48,10 @@  discard block
 block discarded – undo
48 48
 function getChallenge() {
49 49
     
50 50
     
51
-    $ch=curl_init();
52
-    curl_setopt($ch,CURLOPT_URL, "https://www.ticketmaster.com/distil_r_captcha_challenge");
53
-    curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
54
-    curl_setopt($ch,CURLOPT_HTTPHEADER, [
51
+    $ch = curl_init();
52
+    curl_setopt($ch, CURLOPT_URL, "https://www.ticketmaster.com/distil_r_captcha_challenge");
53
+    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
54
+    curl_setopt($ch, CURLOPT_HTTPHEADER, [
55 55
         "Accept: text/html,application/xhtml+xml,application/xml;q=0.9;q=0.8",
56 56
         "Accept-Encoding: deflate",
57 57
         "Accept-Language: en-US,en;q=0.5",
@@ -59,10 +59,10 @@  discard block
 block discarded – undo
59 59
         "Connection: keep-alive",
60 60
         "Host: www.ticketmaster.com"
61 61
     ]);
62
-    curl_setopt($ch,CURLOPT_USERAGENT, "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:50.0) Gecko/20100101 Firefox/50.0");
63
-    curl_setopt($ch,CURLOPT_HEADER,0);
64
-    curl_setopt($ch,CURLOPT_TIMEOUT,10);
65
-    $result =curl_exec($ch);
62
+    curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:50.0) Gecko/20100101 Firefox/50.0");
63
+    curl_setopt($ch, CURLOPT_HEADER, 0);
64
+    curl_setopt($ch, CURLOPT_TIMEOUT, 10);
65
+    $result = curl_exec($ch);
66 66
     $curlError = curl_error($ch);
67 67
     curl_close($ch);
68 68
     
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
         echo "Got HTTP error: $curlError\n";
71 71
         exit;
72 72
     }
73
-    return substr($result, 0, strpos($result,";"));
73
+    return substr($result, 0, strpos($result, ";"));
74 74
     
75 75
 }
76 76
 
Please login to merge, or discard this patch.
src/examples/exampleNoCaptchaProxyless.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,6 +23,6 @@
 block discarded – undo
23 23
     $api->debout("could not solve captcha", "red");
24 24
     $api->debout($api->getErrorMessage());
25 25
 } else {
26
-    $recaptchaToken =   $api->getTaskSolution();
26
+    $recaptchaToken = $api->getTaskSolution();
27 27
     echo "\ntoken result: $recaptchaToken\n\n";
28 28
 }
Please login to merge, or discard this patch.
src/examples/exampleImageToText.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,6 +22,6 @@
 block discarded – undo
22 22
     $api->debout("could not solve captcha", "red");
23 23
     $api->debout($api->getErrorMessage());
24 24
 } else {
25
-    $captchaText    =   $api->getTaskSolution();
25
+    $captchaText = $api->getTaskSolution();
26 26
     echo "\nresult: $captchaText\n\n";
27 27
 }
Please login to merge, or discard this patch.
src/examples/exampleCustomCaptcha.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
     $api->debout("could not solve captcha", "red");
67 67
     $api->debout($api->getErrorMessage());
68 68
 } else {
69
-    $answers =   $api->getTaskSolution();
69
+    $answers = $api->getTaskSolution();
70 70
     foreach ($answers as $key => $value) {
71 71
         echo "answer for question '$key' : '$value'\n";
72 72
     }
Please login to merge, or discard this patch.
src/examples/exampleGeetest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@
 block discarded – undo
21 21
     exit;
22 22
 }
23 23
 
24
-$challenge  =   $data["challenge"];
25
-$gt         =   $data["gt"];
24
+$challenge  = $data["challenge"];
25
+$gt         = $data["gt"];
26 26
 
27 27
 echo "setting gt=$gt, challenge=$challenge\n";
28 28
 
Please login to merge, or discard this patch.
src/examples/exampleNoCaptcha.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,6 +33,6 @@
 block discarded – undo
33 33
     $api->debout("could not solve captcha", "red");
34 34
     $api->debout($api->getErrorMessage());
35 35
 } else {
36
-    $recaptchaToken =   $api->getTaskSolution();
36
+    $recaptchaToken = $api->getTaskSolution();
37 37
     echo "\ntoken result: $recaptchaToken\n\n";
38 38
 }
Please login to merge, or discard this patch.
src/AnticaptchaServiceProvider.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -16,12 +16,12 @@  discard block
 block discarded – undo
16 16
 	public $defer = true;
17 17
 
18 18
 	public function boot() {
19
-		$this->publishes( [
20
-			__DIR__ . '/../config/anticaptcha.php' => config_path( 'anticaptcha.php' ),
21
-		], 'anticaptcha' );
19
+		$this->publishes([
20
+			__DIR__.'/../config/anticaptcha.php' => config_path('anticaptcha.php'),
21
+		], 'anticaptcha');
22 22
 
23 23
 		$this->mergeConfigFrom(
24
-			__DIR__ . '/../config/anticaptcha.php',
24
+			__DIR__.'/../config/anticaptcha.php',
25 25
 			'anticaptcha'
26 26
 		);
27 27
 
@@ -29,58 +29,58 @@  discard block
 block discarded – undo
29 29
 
30 30
 	public function register() {
31 31
 
32
-		$this->app->singleton( NoCaptchaProxyless::class, function ( $app ) {
32
+		$this->app->singleton(NoCaptchaProxyless::class, function($app) {
33 33
 			$instance = new NoCaptchaProxyless();
34
-			$instance->setKey( config( 'anticaptcha.key' ) );
34
+			$instance->setKey(config('anticaptcha.key'));
35 35
 
36 36
 			return $instance;
37 37
 		} );
38 38
 
39
-		$this->app->singleton( NoCaptcha::class, function ( $app ) {
39
+		$this->app->singleton(NoCaptcha::class, function($app) {
40 40
 			$instance = new NoCaptcha();
41
-			$instance->setKey( config( 'anticaptcha.key' ) );
41
+			$instance->setKey(config('anticaptcha.key'));
42 42
 
43 43
 			return $instance;
44 44
 		} );
45 45
 
46
-		$this->app->singleton( ImageToText::class, function ( $app ) {
46
+		$this->app->singleton(ImageToText::class, function($app) {
47 47
 			$instance = new ImageToText();
48
-			$instance->setKey( config( 'anticaptcha.key' ) );
48
+			$instance->setKey(config('anticaptcha.key'));
49 49
 
50 50
 			return $instance;
51 51
 		} );
52 52
 
53
-		$this->app->singleton( GeeTestProxyless::class, function ( $app ) {
53
+		$this->app->singleton(GeeTestProxyless::class, function($app) {
54 54
 			$instance = new GeeTestProxyless();
55
-			$instance->setKey( config( 'anticaptcha.key' ) );
55
+			$instance->setKey(config('anticaptcha.key'));
56 56
 
57 57
 			return $instance;
58 58
 		} );
59 59
 
60
-		$this->app->singleton( GeeTest::class, function ( $app ) {
60
+		$this->app->singleton(GeeTest::class, function($app) {
61 61
 			$instance = new GeeTest();
62
-			$instance->setKey( config( 'anticaptcha.key' ) );
62
+			$instance->setKey(config('anticaptcha.key'));
63 63
 
64 64
 			return $instance;
65 65
 		} );
66 66
 
67
-		$this->app->singleton( FunCaptchaProxyless::class, function ( $app ) {
67
+		$this->app->singleton(FunCaptchaProxyless::class, function($app) {
68 68
 			$instance = new FunCaptchaProxyless();
69
-			$instance->setKey( config( 'anticaptcha.key' ) );
69
+			$instance->setKey(config('anticaptcha.key'));
70 70
 
71 71
 			return $instance;
72 72
 		} );
73 73
 
74
-		$this->app->singleton( FunCaptcha::class, function ( $app ) {
74
+		$this->app->singleton(FunCaptcha::class, function($app) {
75 75
 			$instance = new FunCaptcha();
76
-			$instance->setKey( config( 'anticaptcha.key' ) );
76
+			$instance->setKey(config('anticaptcha.key'));
77 77
 
78 78
 			return $instance;
79 79
 		} );
80 80
 
81
-		$this->app->singleton( CustomCaptcha::class, function ( $app ) {
81
+		$this->app->singleton(CustomCaptcha::class, function($app) {
82 82
 			$instance = new CustomCaptcha();
83
-			$instance->setKey( config( 'anticaptcha.key' ) );
83
+			$instance->setKey(config('anticaptcha.key'));
84 84
 
85 85
 			return $instance;
86 86
 		} );
Please login to merge, or discard this patch.