@@ -300,7 +300,7 @@ |
||
300 | 300 | return false; |
301 | 301 | } |
302 | 302 | |
303 | - $error = (array)$message->error; |
|
303 | + $error = (array) $message->error; |
|
304 | 304 | |
305 | 305 | if (!isset($error['.tag']) && !in_array($error['.tag'], self::ACCESS_TOKEN_STATUS)) { |
306 | 306 | return false; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | public function get(string $filename) |
89 | 89 | { |
90 | 90 | try { |
91 | - return (string)$this->dropboxApp->contentRequest(DropboxApp::ENDPOINT_DOWNLOAD_FILE, $this->dropboxApp->path($filename)); |
|
91 | + return (string) $this->dropboxApp->contentRequest(DropboxApp::ENDPOINT_DOWNLOAD_FILE, $this->dropboxApp->path($filename)); |
|
92 | 92 | } catch (Exception $e) { |
93 | 93 | return false; |
94 | 94 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | public function size(string $filename) |
169 | 169 | { |
170 | 170 | try { |
171 | - $meta = (array)$this->dropboxApp->rpcRequest(DropboxApp::ENDPOINT_FILE_METADATA, $this->dropboxApp->path($filename)); |
|
171 | + $meta = (array) $this->dropboxApp->rpcRequest(DropboxApp::ENDPOINT_FILE_METADATA, $this->dropboxApp->path($filename)); |
|
172 | 172 | return $meta['size']; |
173 | 173 | } catch (Exception $e) { |
174 | 174 | return false; |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | public function lastModified(string $filename) |
182 | 182 | { |
183 | 183 | try { |
184 | - $meta = (array)$this->dropboxApp->rpcRequest(DropboxApp::ENDPOINT_FILE_METADATA, $this->dropboxApp->path($filename)); |
|
184 | + $meta = (array) $this->dropboxApp->rpcRequest(DropboxApp::ENDPOINT_FILE_METADATA, $this->dropboxApp->path($filename)); |
|
185 | 185 | return isset($meta['server_modified']) ? strtotime($meta['server_modified']) : false; |
186 | 186 | } catch (Exception $e) { |
187 | 187 | return false; |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | public function isFile(string $filename): bool |
210 | 210 | { |
211 | 211 | try { |
212 | - $meta = (array)$this->dropboxApp->rpcRequest(DropboxApp::ENDPOINT_FILE_METADATA, $this->dropboxApp->path($filename)); |
|
212 | + $meta = (array) $this->dropboxApp->rpcRequest(DropboxApp::ENDPOINT_FILE_METADATA, $this->dropboxApp->path($filename)); |
|
213 | 213 | return $meta['.tag'] == 'file'; |
214 | 214 | } catch (Exception $e) { |
215 | 215 | return false; |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | public function isDirectory(string $dirname): bool |
224 | 224 | { |
225 | 225 | try { |
226 | - $meta = (array)$this->dropboxApp->rpcRequest(DropboxApp::ENDPOINT_FILE_METADATA, $this->dropboxApp->path($dirname)); |
|
226 | + $meta = (array) $this->dropboxApp->rpcRequest(DropboxApp::ENDPOINT_FILE_METADATA, $this->dropboxApp->path($dirname)); |
|
227 | 227 | return $meta['.tag'] == 'folder'; |
228 | 228 | } catch (Exception $e) { |
229 | 229 | return false; |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | public function listDirectory(string $dirname) |
237 | 237 | { |
238 | 238 | try { |
239 | - $response = (array)$this->dropboxApp->rpcRequest(DropboxApp::ENDPOINT_LIST_FOLDER, $this->dropboxApp->path($dirname)); |
|
239 | + $response = (array) $this->dropboxApp->rpcRequest(DropboxApp::ENDPOINT_LIST_FOLDER, $this->dropboxApp->path($dirname)); |
|
240 | 240 | return $response['entries']; |
241 | 241 | } catch (Exception $e) { |
242 | 242 | return false; |
@@ -362,7 +362,7 @@ |
||
362 | 362 | protected function moveUploadedFile(string $filePath): bool |
363 | 363 | { |
364 | 364 | if ($this->remoteFileSystem) { |
365 | - return (bool)$this->remoteFileSystem->put($filePath, $this->localFileSystem->get($this->getPathname())); |
|
365 | + return (bool) $this->remoteFileSystem->put($filePath, $this->localFileSystem->get($this->getPathname())); |
|
366 | 366 | } else { |
367 | 367 | if ($this->isUploaded()) { |
368 | 368 | return move_uploaded_file($this->getPathname(), $filePath); |
@@ -72,7 +72,7 @@ |
||
72 | 72 | { |
73 | 73 | if (!empty($value)) { |
74 | 74 | $captcha = CaptchaManager::getCaptcha(); |
75 | - if (!$captcha->verifyResponse($value)){ |
|
75 | + if (!$captcha->verifyResponse($value)) { |
|
76 | 76 | $this->addError($field, 'captcha', $param); |
77 | 77 | } |
78 | 78 | } |
@@ -150,8 +150,9 @@ |
||
150 | 150 | */ |
151 | 151 | public function verifyResponse(string $response, $clientIp = null): bool |
152 | 152 | { |
153 | - if (is_null($this->secretkey)) |
|
154 | - throw new \Exception('You must set your secret key'); |
|
153 | + if (is_null($this->secretkey)) { |
|
154 | + throw new \Exception('You must set your secret key'); |
|
155 | + } |
|
155 | 156 | |
156 | 157 | if (empty($response)) { |
157 | 158 |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | */ |
99 | 99 | public function renderJs(): string |
100 | 100 | { |
101 | - return '<script src="'. self::CLIENT_API .'"></script>'; |
|
101 | + return '<script src="' . self::CLIENT_API . '"></script>'; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | public function display(string $formIdentifier = '', array $attributes = []): string |
112 | 112 | { |
113 | 113 | $captchaElement = ''; |
114 | - if (strtolower($this->type) == 'visible'){ |
|
114 | + if (strtolower($this->type) == 'visible') { |
|
115 | 115 | $captchaElement = $this->getVisibleElement(); |
116 | 116 | } elseif (strtolower($this->type) == 'invisible') { |
117 | 117 | $captchaElement = $this->getInvisibleElement($formIdentifier); |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $url = self::VERIFY_URL . '?' . http_build_query($query); |
147 | 147 | |
148 | 148 | $this->http->createRequest($url)->setMethod('GET')->start(); |
149 | - $response = (array)$this->http->getResponseBody(); |
|
149 | + $response = (array) $this->http->getResponseBody(); |
|
150 | 150 | |
151 | 151 | if (empty($response) || is_null($response) || !$response) { |
152 | 152 | return false; |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | }) |
246 | 246 | |
247 | 247 | function onSubmit (){ |
248 | - document.getElementById("'. $formIdentifier .'").submit(); |
|
248 | + document.getElementById("'. $formIdentifier . '").submit(); |
|
249 | 249 | } |
250 | 250 | </script>'; |
251 | 251 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | public function display(string $formIdentifier = '', array $attributes = []): string |
91 | 91 | { |
92 | 92 | $captchaElement = ''; |
93 | - if (strtolower($this->type) == 'visible'){ |
|
93 | + if (strtolower($this->type) == 'visible') { |
|
94 | 94 | $captchaElement = $this->getVisibleElement($attributes); |
95 | 95 | } elseif (strtolower($this->type) == 'invisible') { |
96 | 96 | $captchaElement = $this->getInvisibleElement($formIdentifier); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | */ |
106 | 106 | public function renderJs(): string |
107 | 107 | { |
108 | - return '<script src="'. static::CLIENT_API .'" async defer></script>' . "\n"; |
|
108 | + return '<script src="' . static::CLIENT_API . '" async defer></script>' . "\n"; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | */ |
154 | 154 | public function getErrorCodes(): array |
155 | 155 | { |
156 | - if (!empty($this->errorCodes)){ |
|
156 | + if (!empty($this->errorCodes)) { |
|
157 | 157 | return $this->errorCodes; |
158 | 158 | } |
159 | 159 | return []; |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | { |
171 | 171 | $this->http->createRequest(static::VERIFY_URL)->setMethod('POST')->setData($query)->start(); |
172 | 172 | |
173 | - return (array)$this->http->getResponseBody(); |
|
173 | + return (array) $this->http->getResponseBody(); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | /** |
@@ -218,12 +218,12 @@ discard block |
||
218 | 218 | let button = document.getElementsByTagName("button"); |
219 | 219 | |
220 | 220 | button[0].setAttribute("data-sitekey", "' . $this->sitekey . '"); |
221 | - button[0].setAttribute("data-callback", "'. $functionName .'"); |
|
221 | + button[0].setAttribute("data-callback", "'. $functionName . '"); |
|
222 | 222 | button[0].classList.add("h-captcha"); |
223 | 223 | }) |
224 | 224 | |
225 | - function '. $functionName .'(){ |
|
226 | - document.getElementById("'. $formIdentifier .'").submit(); |
|
225 | + function '. $functionName . '(){ |
|
226 | + document.getElementById("'. $formIdentifier . '").submit(); |
|
227 | 227 | } |
228 | 228 | </script>'; |
229 | 229 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | |
29 | 29 | if (!in_array($captchaAdapter, self::ADAPTERS) && !is_null($captchaAdapter)) { |
30 | 30 | throw CaptchaException::unsupportedAdapter($captchaAdapter); |
31 | - }elseif (is_null($captchaAdapter)){ |
|
31 | + }elseif (is_null($captchaAdapter)) { |
|
32 | 32 | throw new \Exception(''); |
33 | 33 | } |
34 | 34 |
@@ -28,7 +28,7 @@ |
||
28 | 28 | |
29 | 29 | if (!in_array($captchaAdapter, self::ADAPTERS) && !is_null($captchaAdapter)) { |
30 | 30 | throw CaptchaException::unsupportedAdapter($captchaAdapter); |
31 | - }elseif (is_null($captchaAdapter)){ |
|
31 | + } elseif (is_null($captchaAdapter)){ |
|
32 | 32 | throw new \Exception(''); |
33 | 33 | } |
34 | 34 |