@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | |
97 | 97 | self::$__query = self::$server->query(); |
98 | 98 | |
99 | - self::$__headers = array_change_key_case((array)getallheaders(), CASE_LOWER); |
|
99 | + self::$__headers = array_change_key_case((array) getallheaders(), CASE_LOWER); |
|
100 | 100 | |
101 | 101 | list('params' => $params, 'files' => $files) = self::parsedParams(); |
102 | 102 | |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | $csrfToken = null; |
242 | 242 | |
243 | 243 | if (self::has(Csrf::TOKEN_KEY)) { |
244 | - $csrfToken = (string)self::get(Csrf::TOKEN_KEY); |
|
244 | + $csrfToken = (string) self::get(Csrf::TOKEN_KEY); |
|
245 | 245 | } elseif (self::hasHeader('X-' . Csrf::TOKEN_KEY)) { |
246 | 246 | $csrfToken = self::getHeader('X-' . Csrf::TOKEN_KEY); |
247 | 247 | } |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | { |
258 | 258 | $bearerToken = null; |
259 | 259 | |
260 | - $authorization = (string)self::getHeader('Authorization'); |
|
260 | + $authorization = (string) self::getHeader('Authorization'); |
|
261 | 261 | |
262 | 262 | if (self::hasHeader('Authorization')) { |
263 | 263 | if (preg_match('/Bearer\s(\S+)/', $authorization, $matches)) { |
@@ -301,7 +301,7 @@ |
||
301 | 301 | * @param array $arr |
302 | 302 | * @param SimpleXMLElement $simpleXML |
303 | 303 | */ |
304 | - private static function composeXML(array $arr, SimpleXMLElement &$simpleXML) |
|
304 | + private static function composeXML(array $arr, SimpleXMLElement & $simpleXML) |
|
305 | 305 | { |
306 | 306 | foreach ($arr as $key => $value) { |
307 | 307 | if (is_numeric($key)) { |
@@ -158,7 +158,7 @@ |
||
158 | 158 | */ |
159 | 159 | public function fetchData(): ?array |
160 | 160 | { |
161 | - return isset($this->fetchedPayload->data) ? (array)$this->fetchedPayload->data : null; |
|
161 | + return isset($this->fetchedPayload->data) ? (array) $this->fetchedPayload->data : null; |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | /** |
@@ -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); |
@@ -85,7 +85,7 @@ |
||
85 | 85 | */ |
86 | 86 | private function generateRandomKey(): string |
87 | 87 | { |
88 | - return bin2hex(random_bytes((int)$this->getOption('length'))); |
|
88 | + return bin2hex(random_bytes((int) $this->getOption('length'))); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | } |
@@ -58,7 +58,7 @@ |
||
58 | 58 | case 'web': |
59 | 59 | return WebAuth::getInstance(self::getAuthService(), MailerManager::getHandler(), new Hasher); |
60 | 60 | case 'api': |
61 | - $jwt = (new JWToken())->setLeeway(1)->setClaims((array)config()->get('auth.claims')); |
|
61 | + $jwt = (new JWToken())->setLeeway(1)->setClaims((array) config()->get('auth.claims')); |
|
62 | 62 | return ApiAuth::getInstance(self::getAuthService(), MailerManager::getHandler(), new Hasher, $jwt); |
63 | 63 | default: |
64 | 64 | AuthException::undefinedAuthType(); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | if (config()->get('debug')) { |
85 | 85 | $this->mailer->SMTPDebug = SMTP::DEBUG_SERVER; |
86 | 86 | |
87 | - $this->mailer->Debugoutput = function ($message) { |
|
87 | + $this->mailer->Debugoutput = function($message) { |
|
88 | 88 | $this->updateDebugBar($message); |
89 | 89 | }; |
90 | 90 | } |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | */ |
187 | 187 | public function setAttachment(string $attachment): SmtpAdapter |
188 | 188 | { |
189 | - $this->attachments[] = $attachment;; |
|
189 | + $this->attachments[] = $attachment; ; |
|
190 | 190 | return $this; |
191 | 191 | } |
192 | 192 |