Completed
Push — master ( 67dda6...fa8d3b )
by Владислав
02:02
created
src/core/DeCaptchaAbstract.php 2 patches
Doc Comments   +9 added lines, -2 removed lines patch added patch discarded remove patch
@@ -115,6 +115,10 @@  discard block
 block discarded – undo
115 115
         }
116 116
     }
117 117
 
118
+    /**
119
+     * @param integer $param
120
+     * @param string $value
121
+     */
118 122
     public function setParamSpec($param, $value)
119 123
     {
120 124
         $this->paramsSpec[$param] = $value;
@@ -136,6 +140,9 @@  discard block
 block discarded – undo
136 140
         return null;
137 141
     }
138 142
 
143
+    /**
144
+     * @param integer $action
145
+     */
139 146
     protected function getParams($action)
140 147
     {
141 148
         if (empty($this->paramsSettings[$action])) {
@@ -171,7 +178,7 @@  discard block
 block discarded – undo
171 178
     }
172 179
 
173 180
     /**
174
-     * @param array $data
181
+     * @param string $data
175 182
      *
176 183
      * @return string
177 184
      */
@@ -241,7 +248,7 @@  discard block
 block discarded – undo
241 248
     /**
242 249
      * @param $url
243 250
      * @param $data
244
-     * @return mixed
251
+     * @return string
245 252
      * @throws DeCaptchaErrors
246 253
      */
247 254
     protected function getCurlResponse($url, $data)
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -159,10 +159,10 @@  discard block
 block discarded – undo
159 159
             if (array_key_exists($field, $this->paramsNames)) {
160 160
                 switch ($settings[self::PARAM_SLUG_TYPE]) {
161 161
                     case self::PARAM_FIELD_TYPE_INTEGER:
162
-                        $params[$this->paramsNames[$field]] = (int)$value;
162
+                        $params[$this->paramsNames[$field]] = (int) $value;
163 163
                         break;
164 164
                     case self::PARAM_FIELD_TYPE_STRING:
165
-                        $params[$this->paramsNames[$field]] = (string)$value;
165
+                        $params[$this->paramsNames[$field]] = (string) $value;
166 166
                         break;
167 167
                 }
168 168
             }
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
      */
200 200
     protected function getInUrl()
201 201
     {
202
-        return $this->getBaseUrl().$this->inUrl;
202
+        return $this->getBaseUrl() . $this->inUrl;
203 203
     }
204 204
 
205 205
     /**
Please login to merge, or discard this patch.
tests/DeCaptchaAbstractTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     public function testGetBaseUrl()
20 20
     {
21 21
         $abstract = $this->newInstance();
22
-        $getBaseUrlCaller = function () {
22
+        $getBaseUrlCaller = function() {
23 23
             $this->domain = 'domain';
24 24
             return $this->getBaseUrl();
25 25
         };
@@ -51,13 +51,13 @@  discard block
 block discarded – undo
51 51
     public function testGetFilePath()
52 52
     {
53 53
         $abstract = $this->newInstance();
54
-        $getFilePathCaller = function ($val) {
54
+        $getFilePathCaller = function($val) {
55 55
             return $this->getFilePath($val);
56 56
         };
57 57
         $bound = $getFilePathCaller->bindTo($abstract, $abstract);
58
-        $this->assertEquals(__DIR__.'/data/Captcha.jpg', $bound(__DIR__.'/data/Captcha.jpg'));
58
+        $this->assertEquals(__DIR__ . '/data/Captcha.jpg', $bound(__DIR__ . '/data/Captcha.jpg'));
59 59
         $filePathUpload = $bound('https://upload.wikimedia.org/wikipedia/commons/6/69/Captcha.jpg');
60
-        $file1 = file_get_contents(__DIR__.'/data/Captcha.jpg');
60
+        $file1 = file_get_contents(__DIR__ . '/data/Captcha.jpg');
61 61
         $file2 = file_get_contents($filePathUpload);
62 62
         $this->assertEquals($file1, $file2);
63 63
     }
@@ -69,11 +69,11 @@  discard block
 block discarded – undo
69 69
     public function testGetFilePathErrorFileNotFound()
70 70
     {
71 71
         $abstract = $this->newInstance();
72
-        $getFilePathCaller = function ($val) {
72
+        $getFilePathCaller = function($val) {
73 73
             return $this->getFilePath($val);
74 74
         };
75 75
         $bound = $getFilePathCaller->bindTo($abstract, $abstract);
76
-        $bound(__DIR__.'/data/Captcha1.jpg');
76
+        $bound(__DIR__ . '/data/Captcha1.jpg');
77 77
     }
78 78
 
79 79
     /**
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     public function testGetFilePathErrorFileIsNotLoaded()
85 85
     {
86 86
         $abstract = $this->newInstance();
87
-        $getFilePathCaller = function ($val) {
87
+        $getFilePathCaller = function($val) {
88 88
             return $this->getFilePath($val);
89 89
         };
90 90
         $bound = $getFilePathCaller->bindTo($abstract, $abstract);
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
     public function testIsError()
158 158
     {
159 159
         $abstract = $this->newInstance();
160
-        $isErrorCaller = function ($val) {
160
+        $isErrorCaller = function($val) {
161 161
             return $this->isError($val);
162 162
         };
163 163
         $bound = $isErrorCaller->bindTo($abstract, $abstract);
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
     public function testIsErrorNot()
168 168
     {
169 169
         $abstract = $this->newInstance();
170
-        $isErrorCaller = function ($val) {
170
+        $isErrorCaller = function($val) {
171 171
             return $this->isError($val);
172 172
         };
173 173
         $bound = $isErrorCaller->bindTo($abstract, $abstract);
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
     public function testGetCurlResponseError()
183 183
     {
184 184
         $abstract = $this->newInstance();
185
-        $getCurlResponseCaller = function ($url, $val) {
185
+        $getCurlResponseCaller = function($url, $val) {
186 186
             return $this->getCurlResponse($url, $val);
187 187
         };
188 188
         $bound = $getCurlResponseCaller->bindTo($abstract, $abstract);
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
     public function testGetCurlResponse()
193 193
     {
194 194
         $abstract = $this->newInstance();
195
-        $getCurlResponseCaller = function ($url, $val) {
195
+        $getCurlResponseCaller = function($url, $val) {
196 196
             return $this->getCurlResponse($url, $val);
197 197
         };
198 198
         $bound = $getCurlResponseCaller->bindTo($abstract, $abstract);
Please login to merge, or discard this patch.