@@ -24,7 +24,7 @@ |
||
24 | 24 | */ |
25 | 25 | $config = \OC::$server->getConfig(); |
26 | 26 | $state = $config->getSystemValue('ldapIgnoreNamingRules', 'doSet'); |
27 | -if($state === 'doSet') { |
|
27 | +if ($state === 'doSet') { |
|
28 | 28 | \OC::$server->getConfig()->setSystemValue('ldapIgnoreNamingRules', false); |
29 | 29 | } |
30 | 30 |
@@ -256,11 +256,11 @@ discard block |
||
256 | 256 | */ |
257 | 257 | public static function readData($user = null) { |
258 | 258 | if (isset($user)) { |
259 | - $jsonFile = \OC::$server->getUserManager()->get($user)->getHome() . '/mount.json'; |
|
259 | + $jsonFile = \OC::$server->getUserManager()->get($user)->getHome().'/mount.json'; |
|
260 | 260 | } else { |
261 | 261 | $config = \OC::$server->getConfig(); |
262 | - $datadir = $config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data/'); |
|
263 | - $jsonFile = $config->getSystemValue('mount_file', $datadir . '/mount.json'); |
|
262 | + $datadir = $config->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data/'); |
|
263 | + $jsonFile = $config->getSystemValue('mount_file', $datadir.'/mount.json'); |
|
264 | 264 | } |
265 | 265 | if (is_file($jsonFile)) { |
266 | 266 | $mountPoints = json_decode(file_get_contents($jsonFile), true); |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | foreach ($backends as $backend) { |
287 | 287 | foreach ($backend->checkDependencies() as $dependency) { |
288 | 288 | if ($message = $dependency->getMessage()) { |
289 | - $message .= '<p>' . $message . '</p>'; |
|
289 | + $message .= '<p>'.$message.'</p>'; |
|
290 | 290 | } else { |
291 | 291 | $dependencyGroups[$dependency->getDependency()][] = $backend; |
292 | 292 | } |
@@ -295,9 +295,9 @@ discard block |
||
295 | 295 | |
296 | 296 | foreach ($dependencyGroups as $module => $dependants) { |
297 | 297 | $backends = implode(', ', array_map(function($backend) { |
298 | - return '"' . $backend->getText() . '"'; |
|
298 | + return '"'.$backend->getText().'"'; |
|
299 | 299 | }, $dependants)); |
300 | - $message .= '<p>' . OC_Mount_Config::getSingleDependencyMessage($l, $module, $backends) . '</p>'; |
|
300 | + $message .= '<p>'.OC_Mount_Config::getSingleDependencyMessage($l, $module, $backends).'</p>'; |
|
301 | 301 | } |
302 | 302 | |
303 | 303 | return $message; |
@@ -314,11 +314,11 @@ discard block |
||
314 | 314 | private static function getSingleDependencyMessage(\OCP\IL10N $l, $module, $backend) { |
315 | 315 | switch (strtolower($module)) { |
316 | 316 | case 'curl': |
317 | - return (string)$l->t('The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', [$backend]); |
|
317 | + return (string) $l->t('The cURL support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', [$backend]); |
|
318 | 318 | case 'ftp': |
319 | - return (string)$l->t('The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', [$backend]); |
|
319 | + return (string) $l->t('The FTP support in PHP is not enabled or installed. Mounting of %s is not possible. Please ask your system administrator to install it.', [$backend]); |
|
320 | 320 | default: |
321 | - return (string)$l->t('"%s" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it.', [$module, $backend]); |
|
321 | + return (string) $l->t('"%s" is not installed. Mounting of %s is not possible. Please ask your system administrator to install it.', [$module, $backend]); |
|
322 | 322 | } |
323 | 323 | } |
324 | 324 | |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | $cipher = self::getCipher(); |
364 | 364 | $iv = \OC::$server->getSecureRandom()->generate(16); |
365 | 365 | $cipher->setIV($iv); |
366 | - return base64_encode($iv . $cipher->encrypt($password)); |
|
366 | + return base64_encode($iv.$cipher->encrypt($password)); |
|
367 | 367 | } |
368 | 368 | |
369 | 369 | /** |
@@ -128,7 +128,7 @@ |
||
128 | 128 | * @since 8.0.0 |
129 | 129 | * @suppress PhanDeprecatedFunction |
130 | 130 | */ |
131 | - public static function html_select_options($options, $selected, $params=array()) { |
|
131 | + public static function html_select_options($options, $selected, $params = array()) { |
|
132 | 132 | return \html_select_options($options, $selected, $params); |
133 | 133 | } |
134 | 134 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function shouldJoinTags(ISearchOperator $operator) { |
76 | 76 | if ($operator instanceof ISearchBinaryOperator) { |
77 | - return array_reduce($operator->getArguments(), function ($shouldJoin, ISearchOperator $operator) { |
|
77 | + return array_reduce($operator->getArguments(), function($shouldJoin, ISearchOperator $operator) { |
|
78 | 78 | return $shouldJoin || $this->shouldJoinTags($operator); |
79 | 79 | }, false); |
80 | 80 | } else if ($operator instanceof ISearchComparison) { |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * @param ISearchOperator $operator |
89 | 89 | */ |
90 | 90 | public function searchOperatorArrayToDBExprArray(IQueryBuilder $builder, array $operators) { |
91 | - return array_map(function ($operator) use ($builder) { |
|
91 | + return array_map(function($operator) use ($builder) { |
|
92 | 92 | return $this->searchOperatorToDBExpr($builder, $operator); |
93 | 93 | }, $operators); |
94 | 94 | } |
@@ -109,12 +109,12 @@ discard block |
||
109 | 109 | case ISearchBinaryOperator::OPERATOR_OR: |
110 | 110 | return call_user_func_array([$expr, 'orX'], $this->searchOperatorArrayToDBExprArray($builder, $operator->getArguments())); |
111 | 111 | default: |
112 | - throw new \InvalidArgumentException('Invalid operator type: ' . $operator->getType()); |
|
112 | + throw new \InvalidArgumentException('Invalid operator type: '.$operator->getType()); |
|
113 | 113 | } |
114 | 114 | } else if ($operator instanceof ISearchComparison) { |
115 | 115 | return $this->searchComparisonToDBExpr($builder, $operator, self::$searchOperatorMap); |
116 | 116 | } else { |
117 | - throw new \InvalidArgumentException('Invalid operator type: ' . get_class($operator)); |
|
117 | + throw new \InvalidArgumentException('Invalid operator type: '.get_class($operator)); |
|
118 | 118 | } |
119 | 119 | } |
120 | 120 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $queryOperator = $operatorMap[$type]; |
127 | 127 | return $builder->expr()->$queryOperator($field, $this->getParameterForValue($builder, $value)); |
128 | 128 | } else { |
129 | - throw new \InvalidArgumentException('Invalid operator type: ' . $comparison->getType()); |
|
129 | + throw new \InvalidArgumentException('Invalid operator type: '.$comparison->getType()); |
|
130 | 130 | } |
131 | 131 | } |
132 | 132 | |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | $type = ISearchComparison::COMPARE_EQUAL; |
146 | 146 | } |
147 | 147 | if (strpos($value, '%') !== false) { |
148 | - throw new \InvalidArgumentException('Unsupported query value for mimetype: ' . $value . ', only values in the format "mime/type" or "mime/%" are supported'); |
|
148 | + throw new \InvalidArgumentException('Unsupported query value for mimetype: '.$value.', only values in the format "mime/type" or "mime/%" are supported'); |
|
149 | 149 | } |
150 | 150 | } |
151 | 151 | } else if ($field === 'favorite') { |
@@ -178,14 +178,14 @@ discard block |
||
178 | 178 | ]; |
179 | 179 | |
180 | 180 | if (!isset($types[$operator->getField()])) { |
181 | - throw new \InvalidArgumentException('Unsupported comparison field ' . $operator->getField()); |
|
181 | + throw new \InvalidArgumentException('Unsupported comparison field '.$operator->getField()); |
|
182 | 182 | } |
183 | 183 | $type = $types[$operator->getField()]; |
184 | 184 | if (gettype($operator->getValue()) !== $type) { |
185 | - throw new \InvalidArgumentException('Invalid type for field ' . $operator->getField()); |
|
185 | + throw new \InvalidArgumentException('Invalid type for field '.$operator->getField()); |
|
186 | 186 | } |
187 | 187 | if (!in_array($operator->getType(), $comparisons[$operator->getField()])) { |
188 | - throw new \InvalidArgumentException('Unsupported comparison for field ' . $operator->getField() . ': ' . $operator->getType()); |
|
188 | + throw new \InvalidArgumentException('Unsupported comparison for field '.$operator->getField().': '.$operator->getType()); |
|
189 | 189 | } |
190 | 190 | } |
191 | 191 |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | // WARNING: this should be moved to proper AppFramework handling |
24 | 24 | // Check if we are a user |
25 | 25 | if (!\OC::$server->getUserSession()->isLoggedIn()) { |
26 | - header('Location: ' . \OC::$server->getURLGenerator()->linkToRoute( |
|
26 | + header('Location: '.\OC::$server->getURLGenerator()->linkToRoute( |
|
27 | 27 | 'core.login.showLoginForm', |
28 | 28 | [ |
29 | 29 | 'redirect_url' => \OC::$server->getRequest()->getRequestUri(), |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | } |
35 | 35 | // Redirect to 2FA challenge selection if 2FA challenge was not solved yet |
36 | 36 | if (\OC::$server->getTwoFactorAuthManager()->needsSecondFactor(\OC::$server->getUserSession()->getUser())) { |
37 | - header('Location: ' . \OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.selectChallenge')); |
|
37 | + header('Location: '.\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.selectChallenge')); |
|
38 | 38 | exit(); |
39 | 39 | } |
40 | 40 |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | * @return IMemcache |
134 | 134 | */ |
135 | 135 | public function createLocking(string $prefix = ''): IMemcache { |
136 | - return new $this->lockingCacheClass($this->globalPrefix . '/' . $prefix); |
|
136 | + return new $this->lockingCacheClass($this->globalPrefix.'/'.$prefix); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * @return ICache |
144 | 144 | */ |
145 | 145 | public function createDistributed(string $prefix = ''): ICache { |
146 | - return new $this->distributedCacheClass($this->globalPrefix . '/' . $prefix); |
|
146 | + return new $this->distributedCacheClass($this->globalPrefix.'/'.$prefix); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | * @return ICache |
154 | 154 | */ |
155 | 155 | public function createLocal(string $prefix = ''): ICache { |
156 | - return new $this->localCacheClass($this->globalPrefix . '/' . $prefix); |
|
156 | + return new $this->localCacheClass($this->globalPrefix.'/'.$prefix); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | /** |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | if (!($node instanceof File)) { |
173 | 173 | return new JSONResponse(['data' => ['message' => $this->l->t('Please select a file.')]]); |
174 | 174 | } |
175 | - if ($node->getSize() > 20*1024*1024) { |
|
175 | + if ($node->getSize() > 20 * 1024 * 1024) { |
|
176 | 176 | return new JSONResponse( |
177 | 177 | ['data' => ['message' => $this->l->t('File is too big')]], |
178 | 178 | Http::STATUS_BAD_REQUEST |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | is_uploaded_file($files['tmp_name'][0]) && |
201 | 201 | !\OC\Files\Filesystem::isFileBlacklisted($files['tmp_name'][0]) |
202 | 202 | ) { |
203 | - if ($files['size'][0] > 20*1024*1024) { |
|
203 | + if ($files['size'][0] > 20 * 1024 * 1024) { |
|
204 | 204 | return new JSONResponse( |
205 | 205 | ['data' => ['message' => $this->l->t('File is too big')]], |
206 | 206 | Http::STATUS_BAD_REQUEST |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | Http::STATUS_OK, |
293 | 293 | ['Content-Type' => $image->mimeType()]); |
294 | 294 | |
295 | - $resp->setETag((string)crc32($image->data())); |
|
295 | + $resp->setETag((string) crc32($image->data())); |
|
296 | 296 | $resp->cacheFor(0); |
297 | 297 | $resp->setLastModified(new \DateTime('now', new \DateTimeZone('GMT'))); |
298 | 298 | return $resp; |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | |
326 | 326 | $image = new \OC_Image(); |
327 | 327 | $image->loadFromData($tmpAvatar); |
328 | - $image->crop($crop['x'], $crop['y'], (int)round($crop['w']), (int)round($crop['h'])); |
|
328 | + $image->crop($crop['x'], $crop['y'], (int) round($crop['w']), (int) round($crop['h'])); |
|
329 | 329 | try { |
330 | 330 | $avatar = $this->avatarManager->getAvatar($this->userId); |
331 | 331 | $avatar->set($image); |
@@ -151,7 +151,7 @@ |
||
151 | 151 | |
152 | 152 | public function takeOutCurrentUser(array &$users) { |
153 | 153 | $currentUser = $this->userSession->getUser(); |
154 | - if(!is_null($currentUser)) { |
|
154 | + if (!is_null($currentUser)) { |
|
155 | 155 | if (isset($users[$currentUser->getUID()])) { |
156 | 156 | unset($users[$currentUser->getUID()]); |
157 | 157 | } |
@@ -33,8 +33,8 @@ |
||
33 | 33 | /** |
34 | 34 | * @since 14.0.0 |
35 | 35 | */ |
36 | - const EVENT_SUCCESS = self::class . '::success'; |
|
37 | - const EVENT_FAILED = self::class . '::failed'; |
|
36 | + const EVENT_SUCCESS = self::class.'::success'; |
|
37 | + const EVENT_FAILED = self::class.'::failed'; |
|
38 | 38 | |
39 | 39 | /** |
40 | 40 | * Get unique identifier of this 2FA provider |