@@ -127,7 +127,7 @@ |
||
| 127 | 127 | $message = $alias; |
| 128 | 128 | $code = 0; |
| 129 | 129 | } else { |
| 130 | - $message = $this->errorsMessages[ $code ][ $lang ]; |
|
| 130 | + $message = $this->errorsMessages[$code][$lang]; |
|
| 131 | 131 | } |
| 132 | 132 | if ($additionalText) { |
| 133 | 133 | $message .= ": $additionalText"; |
@@ -57,8 +57,8 @@ |
||
| 57 | 57 | sleep($this->requestTimeout); |
| 58 | 58 | } else { |
| 59 | 59 | $ex = explode('|', $result); |
| 60 | - if (trim($ex[ 0 ]) == 'OK') { |
|
| 61 | - $this->result = trim($ex[ 1 ]); |
|
| 60 | + if (trim($ex[0]) == 'OK') { |
|
| 61 | + $this->result = trim($ex[1]); |
|
| 62 | 62 | |
| 63 | 63 | return true; |
| 64 | 64 | } |
@@ -57,8 +57,8 @@ |
||
| 57 | 57 | sleep($this->requestTimeout); |
| 58 | 58 | } else { |
| 59 | 59 | $ex = explode('|', $result); |
| 60 | - if (trim($ex[ 0 ]) == 'OK') { |
|
| 61 | - $this->result = trim($ex[ 1 ]); |
|
| 60 | + if (trim($ex[0]) == 'OK') { |
|
| 61 | + $this->result = trim($ex[1]); |
|
| 62 | 62 | |
| 63 | 63 | return true; |
| 64 | 64 | } |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | // $foo->expects($this->any()) |
| 9 | 9 | // ->method("baz") |
| 10 | 10 | // ->will($this->returnValue("You called baz!")); |
| 11 | - $getBaseUrlCaller = function () { |
|
| 11 | + $getBaseUrlCaller = function() { |
|
| 12 | 12 | return $this->getBaseUrl(); |
| 13 | 13 | }; |
| 14 | 14 | $abstract->domain = 'domain'; |
@@ -20,16 +20,16 @@ discard block |
||
| 20 | 20 | { |
| 21 | 21 | $abstract = $this->getMockForAbstractClass(\jumper423\decaptcha\core\DeCaptchaAbstract::class); |
| 22 | 22 | $abstract->setApiKey('123456val'); |
| 23 | - $apiKeyValCaller = function () { |
|
| 23 | + $apiKeyValCaller = function() { |
|
| 24 | 24 | return $this->apiKey; |
| 25 | 25 | }; |
| 26 | 26 | $bound = $apiKeyValCaller->bindTo($abstract, $abstract); |
| 27 | 27 | $this->assertEquals('123456val', $bound()); |
| 28 | 28 | |
| 29 | - $abstract->setApiKey(function () { |
|
| 29 | + $abstract->setApiKey(function() { |
|
| 30 | 30 | return '123456' . 'fun'; |
| 31 | 31 | }); |
| 32 | - $apiKeyFunCaller = function () { |
|
| 32 | + $apiKeyFunCaller = function() { |
|
| 33 | 33 | return $this->apiKey; |
| 34 | 34 | }; |
| 35 | 35 | $bound = $apiKeyFunCaller->bindTo($abstract, $abstract); |
@@ -39,11 +39,11 @@ discard block |
||
| 39 | 39 | public function testGetActionUrl() |
| 40 | 40 | { |
| 41 | 41 | $abstract = $this->getMockForAbstractClass(\jumper423\decaptcha\core\DeCaptchaAbstract::class); |
| 42 | - $getBaseUrlGetCodeCaller = function () { |
|
| 42 | + $getBaseUrlGetCodeCaller = function() { |
|
| 43 | 43 | $this->captchaId = 123; |
| 44 | 44 | return $this->getActionUrl('get_code'); |
| 45 | 45 | }; |
| 46 | - $getBaseUrlGetBalanceCaller = function () { |
|
| 46 | + $getBaseUrlGetBalanceCaller = function() { |
|
| 47 | 47 | $this->captchaId = 234; |
| 48 | 48 | return $this->getActionUrl('get_balance'); |
| 49 | 49 | }; |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | public function testGetFilePath() |
| 59 | 59 | { |
| 60 | 60 | $abstract = $this->getMockForAbstractClass(\jumper423\decaptcha\core\DeCaptchaAbstract::class); |
| 61 | - $getFilePathCaller = function ($val) { |
|
| 61 | + $getFilePathCaller = function($val) { |
|
| 62 | 62 | return $this->getFilePath($val); |
| 63 | 63 | }; |
| 64 | 64 | $bound = $getFilePathCaller->bindTo($abstract, $abstract); |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | { |
| 78 | 78 | $abstract = $this->getMockForAbstractClass(\jumper423\decaptcha\core\DeCaptchaAbstract::class); |
| 79 | 79 | $abstract->errorLang = \jumper423\decaptcha\core\DeCaptchaErrors::LANG_RU; |
| 80 | - $getFilePathCaller = function ($val) { |
|
| 80 | + $getFilePathCaller = function($val) { |
|
| 81 | 81 | return $this->getFilePath($val); |
| 82 | 82 | }; |
| 83 | 83 | $bound = $getFilePathCaller->bindTo($abstract, $abstract); |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | { |
| 94 | 94 | $abstract = $this->getMockForAbstractClass(\jumper423\decaptcha\core\DeCaptchaAbstract::class); |
| 95 | 95 | $abstract->errorLang = \jumper423\decaptcha\core\DeCaptchaErrors::LANG_RU; |
| 96 | - $getFilePathCaller = function ($val) { |
|
| 96 | + $getFilePathCaller = function($val) { |
|
| 97 | 97 | return $this->getFilePath($val); |
| 98 | 98 | }; |
| 99 | 99 | $bound = $getFilePathCaller->bindTo($abstract, $abstract); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | { |
| 105 | 105 | $abstract = $this->getMockForAbstractClass(\jumper423\decaptcha\core\DeCaptchaAbstract::class); |
| 106 | 106 | $abstract->domain = 'echo.jsontest.com/aaa/bbb'; |
| 107 | - $getResponseCaller = function ($val) { |
|
| 107 | + $getResponseCaller = function($val) { |
|
| 108 | 108 | return $this->getResponse($val); |
| 109 | 109 | }; |
| 110 | 110 | $bound = $getResponseCaller->bindTo($abstract, $abstract); |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | public function testExecutionDelayed() |
| 116 | 116 | { |
| 117 | 117 | $abstract = $this->getMockForAbstractClass(\jumper423\decaptcha\core\DeCaptchaAbstract::class); |
| 118 | - $executionDelayedCaller = function ($second, $call = null) { |
|
| 118 | + $executionDelayedCaller = function($second, $call = null) { |
|
| 119 | 119 | return $this->executionDelayed($second, $call); |
| 120 | 120 | }; |
| 121 | 121 | $bound = $executionDelayedCaller->bindTo($abstract, $abstract); |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | $this->assertTrue(abs($timePassed - 0.1) < 0.025); |
| 127 | 127 | |
| 128 | 128 | $start = microtime(true); |
| 129 | - $bound(0.15, function () { |
|
| 129 | + $bound(0.15, function() { |
|
| 130 | 130 | sleep(0.2); |
| 131 | 131 | }); |
| 132 | 132 | $bound(0.1); |
@@ -134,14 +134,14 @@ discard block |
||
| 134 | 134 | $this->assertTrue(abs($timePassed - 0.25) < 0.025); |
| 135 | 135 | |
| 136 | 136 | $start = microtime(true); |
| 137 | - $bound(0.15, function () { |
|
| 137 | + $bound(0.15, function() { |
|
| 138 | 138 | sleep(0.2); |
| 139 | 139 | }); |
| 140 | 140 | $bound(0.3); |
| 141 | 141 | $timePassed = microtime(true) - $start; |
| 142 | 142 | $this->assertTrue(abs($timePassed - 0.45) < 0.025); |
| 143 | 143 | |
| 144 | - $this->assertEquals(2, $bound(0, function () { |
|
| 144 | + $this->assertEquals(2, $bound(0, function() { |
|
| 145 | 145 | return 2; |
| 146 | 146 | })); |
| 147 | 147 | $this->assertEquals(null, $bound(0)); |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | public function testGetInUrl() |
| 151 | 151 | { |
| 152 | 152 | $abstract = $this->getMockForAbstractClass(\jumper423\decaptcha\core\DeCaptchaAbstract::class); |
| 153 | - $getInUrlCaller = function () { |
|
| 153 | + $getInUrlCaller = function() { |
|
| 154 | 154 | return $this->getInUrl(); |
| 155 | 155 | }; |
| 156 | 156 | $abstract->domain = 'domain'; |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | { |
| 168 | 168 | $abstract = $this->getMockForAbstractClass(\jumper423\decaptcha\core\DeCaptchaAbstract::class); |
| 169 | 169 | $abstract->errorLang = \jumper423\decaptcha\core\DeCaptchaErrors::LANG_RU; |
| 170 | - $isErrorCaller = function ($val) { |
|
| 170 | + $isErrorCaller = function($val) { |
|
| 171 | 171 | return $this->isError($val); |
| 172 | 172 | }; |
| 173 | 173 | $bound = $isErrorCaller->bindTo($abstract, $abstract); |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | { |
| 179 | 179 | $abstract = $this->getMockForAbstractClass(\jumper423\decaptcha\core\DeCaptchaAbstract::class); |
| 180 | 180 | $abstract->errorLang = \jumper423\decaptcha\core\DeCaptchaErrors::LANG_RU; |
| 181 | - $isErrorCaller = function ($val) { |
|
| 181 | + $isErrorCaller = function($val) { |
|
| 182 | 182 | return $this->isError($val); |
| 183 | 183 | }; |
| 184 | 184 | $bound = $isErrorCaller->bindTo($abstract, $abstract); |