@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | * @param \OCP\IL10N $l10n |
| 47 | 47 | * @param Defaults $theme |
| 48 | 48 | */ |
| 49 | - public function __construct($template, $requestToken, $l10n, $theme ) { |
|
| 49 | + public function __construct($template, $requestToken, $l10n, $theme) { |
|
| 50 | 50 | $this->vars = array(); |
| 51 | 51 | $this->vars['requesttoken'] = $requestToken; |
| 52 | 52 | $this->l10n = $l10n; |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | protected function getAppTemplateDirs($theme, $app, $serverRoot, $app_dir) { |
| 65 | 65 | // Check if the app is in the app folder or in the root |
| 66 | - if( file_exists($app_dir.'/templates/' )) { |
|
| 66 | + if (file_exists($app_dir.'/templates/')) { |
|
| 67 | 67 | return [ |
| 68 | 68 | $serverRoot.'/themes/'.$theme.'/apps/'.$app.'/templates/', |
| 69 | 69 | $app_dir.'/templates/', |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | * |
| 99 | 99 | * If the key existed before, it will be overwritten |
| 100 | 100 | */ |
| 101 | - public function assign( $key, $value) { |
|
| 101 | + public function assign($key, $value) { |
|
| 102 | 102 | $this->vars[$key] = $value; |
| 103 | 103 | return true; |
| 104 | 104 | } |
@@ -113,12 +113,12 @@ discard block |
||
| 113 | 113 | * exists, the value will be appended. It can be accessed via |
| 114 | 114 | * $_[$key][$position] in the template. |
| 115 | 115 | */ |
| 116 | - public function append( $key, $value ) { |
|
| 117 | - if( array_key_exists( $key, $this->vars )) { |
|
| 116 | + public function append($key, $value) { |
|
| 117 | + if (array_key_exists($key, $this->vars)) { |
|
| 118 | 118 | $this->vars[$key][] = $value; |
| 119 | 119 | } |
| 120 | - else{ |
|
| 121 | - $this->vars[$key] = array( $value ); |
|
| 120 | + else { |
|
| 121 | + $this->vars[$key] = array($value); |
|
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 | |
@@ -130,10 +130,10 @@ discard block |
||
| 130 | 130 | */ |
| 131 | 131 | public function printPage() { |
| 132 | 132 | $data = $this->fetchPage(); |
| 133 | - if( $data === false ) { |
|
| 133 | + if ($data === false) { |
|
| 134 | 134 | return false; |
| 135 | 135 | } |
| 136 | - else{ |
|
| 136 | + else { |
|
| 137 | 137 | print $data; |
| 138 | 138 | return true; |
| 139 | 139 | } |
@@ -166,8 +166,8 @@ discard block |
||
| 166 | 166 | $l = $this->l10n; |
| 167 | 167 | $theme = $this->theme; |
| 168 | 168 | |
| 169 | - if( !is_null($additionalParams)) { |
|
| 170 | - $_ = array_merge( $additionalParams, $this->vars ); |
|
| 169 | + if (!is_null($additionalParams)) { |
|
| 170 | + $_ = array_merge($additionalParams, $this->vars); |
|
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | // Include |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | if ($host === '') { |
| 134 | 134 | $additionalConnectionParams['dbname'] = $dbName; // use dbname as easy connect name |
| 135 | 135 | } else { |
| 136 | - $additionalConnectionParams['dbname'] = '//' . $host . (!empty($port) ? ":{$port}" : "") . '/' . $dbName; |
|
| 136 | + $additionalConnectionParams['dbname'] = '//'.$host.(!empty($port) ? ":{$port}" : "").'/'.$dbName; |
|
| 137 | 137 | } |
| 138 | 138 | unset($additionalConnectionParams['host']); |
| 139 | 139 | break; |
@@ -187,8 +187,8 @@ discard block |
||
| 187 | 187 | $name = $this->config->getValue('dbname', 'owncloud'); |
| 188 | 188 | |
| 189 | 189 | if ($this->normalizeType($type) === 'sqlite3') { |
| 190 | - $dataDir = $this->config->getValue("datadirectory", \OC::$SERVERROOT . '/data'); |
|
| 191 | - $connectionParams['path'] = $dataDir . '/' . $name . '.db'; |
|
| 190 | + $dataDir = $this->config->getValue("datadirectory", \OC::$SERVERROOT.'/data'); |
|
| 191 | + $connectionParams['path'] = $dataDir.'/'.$name.'.db'; |
|
| 192 | 192 | } else { |
| 193 | 193 | $host = $this->config->getValue('dbhost', ''); |
| 194 | 194 | if (strpos($host, ':')) { |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | if ($remoteShare) { |
| 183 | 183 | try { |
| 184 | 184 | $ownerCloudId = $this->cloudIdManager->getCloudId($remoteShare['owner'], $remoteShare['remote']); |
| 185 | - $shareId = $this->addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $ownerCloudId->getId(), $permissions, 'tmp_token_' . time()); |
|
| 185 | + $shareId = $this->addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $ownerCloudId->getId(), $permissions, 'tmp_token_'.time()); |
|
| 186 | 186 | $share->setId($shareId); |
| 187 | 187 | list($token, $remoteId) = $this->askOwnerToReShare($shareWith, $share, $shareId); |
| 188 | 188 | // remote share was create successfully if we get a valid token as return |
@@ -254,11 +254,11 @@ discard block |
||
| 254 | 254 | $failure = true; |
| 255 | 255 | } |
| 256 | 256 | } catch (\Exception $e) { |
| 257 | - $this->logger->error('Failed to notify remote server of federated share, removing share (' . $e->getMessage() . ')'); |
|
| 257 | + $this->logger->error('Failed to notify remote server of federated share, removing share ('.$e->getMessage().')'); |
|
| 258 | 258 | $failure = true; |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | - if($failure) { |
|
| 261 | + if ($failure) { |
|
| 262 | 262 | $this->removeShareFromTableById($shareId); |
| 263 | 263 | $message_t = $this->l->t('Sharing %s failed, could not find %s, maybe the server is currently unreachable or uses a self-signed certificate.', |
| 264 | 264 | [$share->getNode()->getName(), $share->getSharedWith()]); |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | ->andWhere($query->expr()->eq('mountpoint', $query->createNamedParameter($share->getTarget()))); |
| 310 | 310 | $result = $query->execute()->fetchAll(); |
| 311 | 311 | |
| 312 | - if (isset($result[0]) && (int)$result[0]['remote_id'] > 0) { |
|
| 312 | + if (isset($result[0]) && (int) $result[0]['remote_id'] > 0) { |
|
| 313 | 313 | return $result[0]; |
| 314 | 314 | } |
| 315 | 315 | |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | $qb->execute(); |
| 352 | 352 | $id = $qb->getLastInsertId(); |
| 353 | 353 | |
| 354 | - return (int)$id; |
|
| 354 | + return (int) $id; |
|
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | /** |
@@ -441,14 +441,14 @@ discard block |
||
| 441 | 441 | public function getRemoteId(IShare $share) { |
| 442 | 442 | $query = $this->dbConnection->getQueryBuilder(); |
| 443 | 443 | $query->select('remote_id')->from('federated_reshares') |
| 444 | - ->where($query->expr()->eq('share_id', $query->createNamedParameter((int)$share->getId()))); |
|
| 444 | + ->where($query->expr()->eq('share_id', $query->createNamedParameter((int) $share->getId()))); |
|
| 445 | 445 | $data = $query->execute()->fetch(); |
| 446 | 446 | |
| 447 | 447 | if (!is_array($data) || !isset($data['remote_id'])) { |
| 448 | 448 | throw new ShareNotFound(); |
| 449 | 449 | } |
| 450 | 450 | |
| 451 | - return (int)$data['remote_id']; |
|
| 451 | + return (int) $data['remote_id']; |
|
| 452 | 452 | } |
| 453 | 453 | |
| 454 | 454 | /** |
@@ -479,7 +479,7 @@ discard block |
||
| 479 | 479 | ->orderBy('id'); |
| 480 | 480 | |
| 481 | 481 | $cursor = $qb->execute(); |
| 482 | - while($data = $cursor->fetch()) { |
|
| 482 | + while ($data = $cursor->fetch()) { |
|
| 483 | 483 | $children[] = $this->createShareObject($data); |
| 484 | 484 | } |
| 485 | 485 | $cursor->closeCursor(); |
@@ -608,7 +608,7 @@ discard block |
||
| 608 | 608 | ); |
| 609 | 609 | } |
| 610 | 610 | |
| 611 | - $qb->innerJoin('s', 'filecache' ,'f', $qb->expr()->eq('s.file_source', 'f.fileid')); |
|
| 611 | + $qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid')); |
|
| 612 | 612 | $qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId()))); |
| 613 | 613 | |
| 614 | 614 | $qb->orderBy('id'); |
@@ -671,7 +671,7 @@ discard block |
||
| 671 | 671 | |
| 672 | 672 | $cursor = $qb->execute(); |
| 673 | 673 | $shares = []; |
| 674 | - while($data = $cursor->fetch()) { |
|
| 674 | + while ($data = $cursor->fetch()) { |
|
| 675 | 675 | $shares[] = $this->createShareObject($data); |
| 676 | 676 | } |
| 677 | 677 | $cursor->closeCursor(); |
@@ -723,7 +723,7 @@ discard block |
||
| 723 | 723 | ->execute(); |
| 724 | 724 | |
| 725 | 725 | $shares = []; |
| 726 | - while($data = $cursor->fetch()) { |
|
| 726 | + while ($data = $cursor->fetch()) { |
|
| 727 | 727 | $shares[] = $this->createShareObject($data); |
| 728 | 728 | } |
| 729 | 729 | $cursor->closeCursor(); |
@@ -762,7 +762,7 @@ discard block |
||
| 762 | 762 | |
| 763 | 763 | $cursor = $qb->execute(); |
| 764 | 764 | |
| 765 | - while($data = $cursor->fetch()) { |
|
| 765 | + while ($data = $cursor->fetch()) { |
|
| 766 | 766 | $shares[] = $this->createShareObject($data); |
| 767 | 767 | } |
| 768 | 768 | $cursor->closeCursor(); |
@@ -839,15 +839,15 @@ discard block |
||
| 839 | 839 | private function createShareObject($data) { |
| 840 | 840 | |
| 841 | 841 | $share = new Share($this->rootFolder, $this->userManager); |
| 842 | - $share->setId((int)$data['id']) |
|
| 843 | - ->setShareType((int)$data['share_type']) |
|
| 844 | - ->setPermissions((int)$data['permissions']) |
|
| 842 | + $share->setId((int) $data['id']) |
|
| 843 | + ->setShareType((int) $data['share_type']) |
|
| 844 | + ->setPermissions((int) $data['permissions']) |
|
| 845 | 845 | ->setTarget($data['file_target']) |
| 846 | - ->setMailSend((bool)$data['mail_send']) |
|
| 846 | + ->setMailSend((bool) $data['mail_send']) |
|
| 847 | 847 | ->setToken($data['token']); |
| 848 | 848 | |
| 849 | 849 | $shareTime = new \DateTime(); |
| 850 | - $shareTime->setTimestamp((int)$data['stime']); |
|
| 850 | + $shareTime->setTimestamp((int) $data['stime']); |
|
| 851 | 851 | $share->setShareTime($shareTime); |
| 852 | 852 | $share->setSharedWith($data['share_with']); |
| 853 | 853 | |
@@ -857,13 +857,13 @@ discard block |
||
| 857 | 857 | } else { |
| 858 | 858 | //OLD SHARE |
| 859 | 859 | $share->setSharedBy($data['uid_owner']); |
| 860 | - $path = $this->getNode($share->getSharedBy(), (int)$data['file_source']); |
|
| 860 | + $path = $this->getNode($share->getSharedBy(), (int) $data['file_source']); |
|
| 861 | 861 | |
| 862 | 862 | $owner = $path->getOwner(); |
| 863 | 863 | $share->setShareOwner($owner->getUID()); |
| 864 | 864 | } |
| 865 | 865 | |
| 866 | - $share->setNodeId((int)$data['file_source']); |
|
| 866 | + $share->setNodeId((int) $data['file_source']); |
|
| 867 | 867 | $share->setNodeType($data['item_type']); |
| 868 | 868 | |
| 869 | 869 | $share->setProviderId($this->identifier()); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | $item = $node; |
| 117 | - $appendix = '/' . $node->getName(); |
|
| 117 | + $appendix = '/'.$node->getName(); |
|
| 118 | 118 | while (!empty($byId)) { |
| 119 | 119 | try { |
| 120 | 120 | /** @var Node $item */ |
@@ -122,12 +122,12 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | if (!empty($byId[$item->getId()])) { |
| 124 | 124 | foreach ($byId[$item->getId()] as $uid => $path) { |
| 125 | - $results[$uid] = $path . $appendix; |
|
| 125 | + $results[$uid] = $path.$appendix; |
|
| 126 | 126 | } |
| 127 | 127 | unset($byId[$item->getId()]); |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - $appendix = '/' . $item->getName() . $appendix; |
|
| 130 | + $appendix = '/'.$item->getName().$appendix; |
|
| 131 | 131 | } catch (NotFoundException $e) { |
| 132 | 132 | return $results; |
| 133 | 133 | } catch (InvalidPathException $e) { |
@@ -212,6 +212,6 @@ discard block |
||
| 212 | 212 | protected function getMountedPath(Node $node) { |
| 213 | 213 | $path = $node->getPath(); |
| 214 | 214 | $sections = explode('/', $path, 4); |
| 215 | - return '/' . $sections[3]; |
|
| 215 | + return '/'.$sections[3]; |
|
| 216 | 216 | } |
| 217 | 217 | } |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | static public function enableCaching($cache_time = null) { |
| 49 | 49 | if (is_numeric($cache_time)) { |
| 50 | - header('Pragma: public');// enable caching in IE |
|
| 50 | + header('Pragma: public'); // enable caching in IE |
|
| 51 | 51 | if ($cache_time > 0) { |
| 52 | 52 | self::setExpiresHeader('PT'.$cache_time.'S'); |
| 53 | 53 | header('Cache-Control: max-age='.$cache_time.', must-revalidate'); |
@@ -78,29 +78,29 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | static public function setStatus($status) { |
| 80 | 80 | $protocol = \OC::$server->getRequest()->getHttpProtocol(); |
| 81 | - switch($status) { |
|
| 81 | + switch ($status) { |
|
| 82 | 82 | case self::STATUS_NOT_MODIFIED: |
| 83 | - $status = $status . ' Not Modified'; |
|
| 83 | + $status = $status.' Not Modified'; |
|
| 84 | 84 | break; |
| 85 | 85 | case self::STATUS_TEMPORARY_REDIRECT: |
| 86 | 86 | if ($protocol == 'HTTP/1.1') { |
| 87 | - $status = $status . ' Temporary Redirect'; |
|
| 87 | + $status = $status.' Temporary Redirect'; |
|
| 88 | 88 | break; |
| 89 | 89 | } else { |
| 90 | 90 | $status = self::STATUS_FOUND; |
| 91 | 91 | // fallthrough |
| 92 | 92 | } |
| 93 | 93 | case self::STATUS_FOUND; |
| 94 | - $status = $status . ' Found'; |
|
| 94 | + $status = $status.' Found'; |
|
| 95 | 95 | break; |
| 96 | 96 | case self::STATUS_NOT_FOUND; |
| 97 | - $status = $status . ' Not Found'; |
|
| 97 | + $status = $status.' Not Found'; |
|
| 98 | 98 | break; |
| 99 | 99 | case self::STATUS_INTERNAL_SERVER_ERROR; |
| 100 | - $status = $status . ' Internal Server Error'; |
|
| 100 | + $status = $status.' Internal Server Error'; |
|
| 101 | 101 | break; |
| 102 | 102 | case self::STATUS_SERVICE_UNAVAILABLE; |
| 103 | - $status = $status . ' Service Unavailable'; |
|
| 103 | + $status = $status.' Service Unavailable'; |
|
| 104 | 104 | break; |
| 105 | 105 | } |
| 106 | 106 | header($protocol.' '.$status); |
@@ -180,17 +180,17 @@ discard block |
||
| 180 | 180 | * @param string $filename file name |
| 181 | 181 | * @param string $type disposition type, either 'attachment' or 'inline' |
| 182 | 182 | */ |
| 183 | - static public function setContentDispositionHeader( $filename, $type = 'attachment' ) { |
|
| 183 | + static public function setContentDispositionHeader($filename, $type = 'attachment') { |
|
| 184 | 184 | if (\OC::$server->getRequest()->isUserAgent( |
| 185 | 185 | [ |
| 186 | 186 | \OC\AppFramework\Http\Request::USER_AGENT_IE, |
| 187 | 187 | \OC\AppFramework\Http\Request::USER_AGENT_ANDROID_MOBILE_CHROME, |
| 188 | 188 | \OC\AppFramework\Http\Request::USER_AGENT_FREEBOX, |
| 189 | 189 | ])) { |
| 190 | - header( 'Content-Disposition: ' . rawurlencode($type) . '; filename="' . rawurlencode( $filename ) . '"' ); |
|
| 190 | + header('Content-Disposition: '.rawurlencode($type).'; filename="'.rawurlencode($filename).'"'); |
|
| 191 | 191 | } else { |
| 192 | - header( 'Content-Disposition: ' . rawurlencode($type) . '; filename*=UTF-8\'\'' . rawurlencode( $filename ) |
|
| 193 | - . '; filename="' . rawurlencode( $filename ) . '"' ); |
|
| 192 | + header('Content-Disposition: '.rawurlencode($type).'; filename*=UTF-8\'\''.rawurlencode($filename) |
|
| 193 | + . '; filename="'.rawurlencode($filename).'"'); |
|
| 194 | 194 | } |
| 195 | 195 | } |
| 196 | 196 | |
@@ -256,12 +256,12 @@ discard block |
||
| 256 | 256 | . 'connect-src *; ' |
| 257 | 257 | . 'object-src \'none\'; ' |
| 258 | 258 | . 'base-uri \'self\'; '; |
| 259 | - header('Content-Security-Policy:' . $policy); |
|
| 259 | + header('Content-Security-Policy:'.$policy); |
|
| 260 | 260 | header('X-Frame-Options: SAMEORIGIN'); // Disallow iFraming from other domains |
| 261 | 261 | |
| 262 | 262 | // Send fallback headers for installations that don't have the possibility to send |
| 263 | 263 | // custom headers on the webserver side |
| 264 | - if(getenv('modHeadersAvailable') !== 'true') { |
|
| 264 | + if (getenv('modHeadersAvailable') !== 'true') { |
|
| 265 | 265 | header('X-XSS-Protection: 1; mode=block'); // Enforce browser based XSS filters |
| 266 | 266 | header('X-Content-Type-Options: nosniff'); // Disable sniffing the content type for IE |
| 267 | 267 | header('X-Robots-Tag: none'); // https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | * @return string |
| 174 | 174 | */ |
| 175 | 175 | public function getId() { |
| 176 | - return 'shared::' . $this->getMountPoint(); |
|
| 176 | + return 'shared::'.$this->getMountPoint(); |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | /** |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | } |
| 270 | 270 | } |
| 271 | 271 | $info = array( |
| 272 | - 'target' => $this->getMountPoint() . $path, |
|
| 272 | + 'target' => $this->getMountPoint().$path, |
|
| 273 | 273 | 'source' => $source, |
| 274 | 274 | 'mode' => $mode, |
| 275 | 275 | ); |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | |
| 479 | 479 | public function file_get_contents($path) { |
| 480 | 480 | $info = [ |
| 481 | - 'target' => $this->getMountPoint() . '/' . $path, |
|
| 481 | + 'target' => $this->getMountPoint().'/'.$path, |
|
| 482 | 482 | 'source' => $this->getUnjailedPath($path), |
| 483 | 483 | ]; |
| 484 | 484 | \OCP\Util::emitHook('\OC\Files\Storage\Shared', 'file_get_contents', $info); |
@@ -487,7 +487,7 @@ discard block |
||
| 487 | 487 | |
| 488 | 488 | public function file_put_contents($path, $data) { |
| 489 | 489 | $info = [ |
| 490 | - 'target' => $this->getMountPoint() . '/' . $path, |
|
| 490 | + 'target' => $this->getMountPoint().'/'.$path, |
|
| 491 | 491 | 'source' => $this->getUnjailedPath($path), |
| 492 | 492 | ]; |
| 493 | 493 | \OCP\Util::emitHook('\OC\Files\Storage\Shared', 'file_put_contents', $info); |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | protected function setSubjects(IEvent $event, $subject, array $parameters) { |
| 50 | 50 | $placeholders = $replacements = []; |
| 51 | 51 | foreach ($parameters as $placeholder => $parameter) { |
| 52 | - $placeholders[] = '{' . $placeholder . '}'; |
|
| 52 | + $placeholders[] = '{'.$placeholder.'}'; |
|
| 53 | 53 | $replacements[] = $parameter['name']; |
| 54 | 54 | } |
| 55 | 55 | |
@@ -39,22 +39,22 @@ |
||
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | public function md5($input) { |
| 42 | - return new QueryFunction('MD5(' . $this->helper->quoteColumnName($input) . ')'); |
|
| 42 | + return new QueryFunction('MD5('.$this->helper->quoteColumnName($input).')'); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | public function concat($x, $y) { |
| 46 | - return new QueryFunction('CONCAT(' . $this->helper->quoteColumnName($x) . ', ' . $this->helper->quoteColumnName($y) . ')'); |
|
| 46 | + return new QueryFunction('CONCAT('.$this->helper->quoteColumnName($x).', '.$this->helper->quoteColumnName($y).')'); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | public function substring($input, $start, $length = null) { |
| 50 | 50 | if ($length) { |
| 51 | - return new QueryFunction('SUBSTR(' . $this->helper->quoteColumnName($input) . ', ' . $this->helper->quoteColumnName($start) . ', ' . $this->helper->quoteColumnName($length) . ')'); |
|
| 51 | + return new QueryFunction('SUBSTR('.$this->helper->quoteColumnName($input).', '.$this->helper->quoteColumnName($start).', '.$this->helper->quoteColumnName($length).')'); |
|
| 52 | 52 | } else { |
| 53 | - return new QueryFunction('SUBSTR(' . $this->helper->quoteColumnName($input) . ', ' . $this->helper->quoteColumnName($start) . ')'); |
|
| 53 | + return new QueryFunction('SUBSTR('.$this->helper->quoteColumnName($input).', '.$this->helper->quoteColumnName($start).')'); |
|
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | public function sum($field) { |
| 58 | - return new QueryFunction('SUM(' . $this->helper->quoteColumnName($field) . ')'); |
|
| 58 | + return new QueryFunction('SUM('.$this->helper->quoteColumnName($field).')'); |
|
| 59 | 59 | } |
| 60 | 60 | } |
@@ -60,8 +60,8 @@ discard block |
||
| 60 | 60 | $userIdentifier, |
| 61 | 61 | $period, |
| 62 | 62 | $limit) { |
| 63 | - $existingAttempts = $this->backend->getAttempts($methodIdentifier, $userIdentifier, (int)$period); |
|
| 64 | - if ($existingAttempts >= (int)$limit) { |
|
| 63 | + $existingAttempts = $this->backend->getAttempts($methodIdentifier, $userIdentifier, (int) $period); |
|
| 64 | + if ($existingAttempts >= (int) $limit) { |
|
| 65 | 65 | throw new RateLimitExceededException(); |
| 66 | 66 | } |
| 67 | 67 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | $ip) { |
| 84 | 84 | $ipSubnet = (new IpAddress($ip))->getSubnet(); |
| 85 | 85 | |
| 86 | - $anonHashIdentifier = hash('sha512', 'anon::' . $identifier . $ipSubnet); |
|
| 86 | + $anonHashIdentifier = hash('sha512', 'anon::'.$identifier.$ipSubnet); |
|
| 87 | 87 | $this->register($identifier, $anonHashIdentifier, $anonPeriod, $anonLimit); |
| 88 | 88 | } |
| 89 | 89 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $userLimit, |
| 101 | 101 | $userPeriod, |
| 102 | 102 | IUser $user) { |
| 103 | - $userHashIdentifier = hash('sha512', 'user::' . $identifier . $user->getUID()); |
|
| 103 | + $userHashIdentifier = hash('sha512', 'user::'.$identifier.$user->getUID()); |
|
| 104 | 104 | $this->register($identifier, $userHashIdentifier, $userPeriod, $userLimit); |
| 105 | 105 | } |
| 106 | 106 | } |