@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | string $ip) { |
87 | 87 | $ipSubnet = (new IpAddress($ip))->getSubnet(); |
88 | 88 | |
89 | - $anonHashIdentifier = hash('sha512', 'anon::' . $identifier . $ipSubnet); |
|
89 | + $anonHashIdentifier = hash('sha512', 'anon::'.$identifier.$ipSubnet); |
|
90 | 90 | $this->register($identifier, $anonHashIdentifier, $anonPeriod, $anonLimit); |
91 | 91 | } |
92 | 92 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | int $userLimit, |
104 | 104 | int $userPeriod, |
105 | 105 | IUser $user) { |
106 | - $userHashIdentifier = hash('sha512', 'user::' . $identifier . $user->getUID()); |
|
106 | + $userHashIdentifier = hash('sha512', 'user::'.$identifier.$user->getUID()); |
|
107 | 107 | $this->register($identifier, $userHashIdentifier, $userPeriod, $userLimit); |
108 | 108 | } |
109 | 109 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | private function hash(string $methodIdentifier, |
59 | 59 | string $userIdentifier): string { |
60 | - return hash('sha512', $methodIdentifier . $userIdentifier); |
|
60 | + return hash('sha512', $methodIdentifier.$userIdentifier); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | $cachedAttempts = json_decode($cachedAttempts, true); |
74 | - if(\is_array($cachedAttempts)) { |
|
74 | + if (\is_array($cachedAttempts)) { |
|
75 | 75 | return $cachedAttempts; |
76 | 76 | } |
77 | 77 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $currentTime = $this->timeFactory->getTime(); |
92 | 92 | /** @var array $existingAttempts */ |
93 | 93 | foreach ($existingAttempts as $attempt) { |
94 | - if(($attempt + $seconds) > $currentTime) { |
|
94 | + if (($attempt + $seconds) > $currentTime) { |
|
95 | 95 | $count++; |
96 | 96 | } |
97 | 97 | } |
@@ -111,14 +111,14 @@ discard block |
||
111 | 111 | |
112 | 112 | // Unset all attempts older than $period |
113 | 113 | foreach ($existingAttempts as $key => $attempt) { |
114 | - if(($attempt + $period) < $currentTime) { |
|
114 | + if (($attempt + $period) < $currentTime) { |
|
115 | 115 | unset($existingAttempts[$key]); |
116 | 116 | } |
117 | 117 | } |
118 | 118 | $existingAttempts = array_values($existingAttempts); |
119 | 119 | |
120 | 120 | // Store the new attempt |
121 | - $existingAttempts[] = (string)$currentTime; |
|
121 | + $existingAttempts[] = (string) $currentTime; |
|
122 | 122 | $this->cache->set($identifier, json_encode($existingAttempts)); |
123 | 123 | } |
124 | 124 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function getCapabilities(bool $public = false) : array { |
53 | 53 | $capabilities = []; |
54 | - foreach($this->capabilities as $capability) { |
|
54 | + foreach ($this->capabilities as $capability) { |
|
55 | 55 | try { |
56 | 56 | $c = $capability(); |
57 | 57 | } catch (QueryException $e) { |
@@ -64,11 +64,11 @@ discard block |
||
64 | 64 | } |
65 | 65 | |
66 | 66 | if ($c instanceof ICapability) { |
67 | - if(!$public || $c instanceof IPublicCapability) { |
|
67 | + if (!$public || $c instanceof IPublicCapability) { |
|
68 | 68 | $capabilities = array_replace_recursive($capabilities, $c->getCapabilities()); |
69 | 69 | } |
70 | 70 | } else { |
71 | - throw new \InvalidArgumentException('The given Capability (' . get_class($c) . ') does not implement the ICapability interface'); |
|
71 | + throw new \InvalidArgumentException('The given Capability ('.get_class($c).') does not implement the ICapability interface'); |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 |
@@ -60,7 +60,7 @@ |
||
60 | 60 | * @return string the starting namespace for the app |
61 | 61 | * @since 8.0.0 |
62 | 62 | */ |
63 | - public static function buildAppNamespace(string $appId, string $topNamespace='OCA\\'): string { |
|
63 | + public static function buildAppNamespace(string $appId, string $topNamespace = 'OCA\\'): string { |
|
64 | 64 | return \OC\AppFramework\App::buildAppNamespace($appId, $topNamespace); |
65 | 65 | } |
66 | 66 |
@@ -62,7 +62,7 @@ |
||
62 | 62 | */ |
63 | 63 | public function addEntityCollection(string $name, \Closure $entityExistsFunction) { |
64 | 64 | if (isset($this->collections[$name])) { |
65 | - throw new \OutOfBoundsException('Duplicate entity name "' . $name . '"'); |
|
65 | + throw new \OutOfBoundsException('Duplicate entity name "'.$name.'"'); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | $this->collections[$name] = $entityExistsFunction; |
@@ -63,5 +63,5 @@ |
||
63 | 63 | * @return bool Whether $hash is a valid hash of $message |
64 | 64 | * @since 8.0.0 |
65 | 65 | */ |
66 | - public function verify(string $message, string $hash, &$newHash = null): bool ; |
|
66 | + public function verify(string $message, string $hash, &$newHash = null): bool; |
|
67 | 67 | } |
@@ -67,6 +67,6 @@ |
||
67 | 67 | $implements |= Backend::COUNT_USERS; |
68 | 68 | } |
69 | 69 | |
70 | - return (bool)($actions & $implements); |
|
70 | + return (bool) ($actions & $implements); |
|
71 | 71 | } |
72 | 72 | } |
@@ -62,6 +62,6 @@ |
||
62 | 62 | $implements |= GroupInterface::REMOVE_FROM_GOUP; |
63 | 63 | } |
64 | 64 | |
65 | - return (bool)($actions & $implements); |
|
65 | + return (bool) ($actions & $implements); |
|
66 | 66 | } |
67 | 67 | } |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | array $params, |
51 | 51 | array $elements, |
52 | 52 | bool $obfuscateParameters = false) { |
53 | - foreach($elements as $element) { |
|
54 | - if(!isset($params[$element])) { |
|
53 | + foreach ($elements as $element) { |
|
54 | + if (!isset($params[$element])) { |
|
55 | 55 | if ($obfuscateParameters) { |
56 | 56 | $this->logger->critical( |
57 | 57 | '$params["'.$element.'"] was missing.', |
@@ -71,8 +71,8 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | $replaceArray = []; |
74 | - foreach($elements as $element) { |
|
75 | - if($params[$element] instanceof \DateTime) { |
|
74 | + foreach ($elements as $element) { |
|
75 | + if ($params[$element] instanceof \DateTime) { |
|
76 | 76 | $params[$element] = $params[$element]->format('Y-m-d H:i:s'); |
77 | 77 | } |
78 | 78 | $replaceArray[] = $params[$element]; |