@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | } |
54 | 54 | |
55 | 55 | if ($this->cache !== null) { |
56 | - $fileCacheKey = $file . filemtime($file); |
|
56 | + $fileCacheKey = $file.filemtime($file); |
|
57 | 57 | if ($cachedValue = $this->cache->get($fileCacheKey)) { |
58 | 58 | return json_decode($cachedValue, true); |
59 | 59 | } |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | */ |
230 | 230 | public function xmlToArray($xml) { |
231 | 231 | if (!$xml->children()) { |
232 | - return (string)$xml; |
|
232 | + return (string) $xml; |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | $array = []; |
@@ -245,16 +245,16 @@ discard block |
||
245 | 245 | $data = [ |
246 | 246 | '@attributes' => [], |
247 | 247 | ]; |
248 | - if (!count($node->children())){ |
|
249 | - $value = (string)$node; |
|
248 | + if (!count($node->children())) { |
|
249 | + $value = (string) $node; |
|
250 | 250 | if (!empty($value)) { |
251 | - $data['@value'] = (string)$node; |
|
251 | + $data['@value'] = (string) $node; |
|
252 | 252 | } |
253 | 253 | } else { |
254 | 254 | $data = array_merge($data, $this->xmlToArray($node)); |
255 | 255 | } |
256 | 256 | foreach ($attributes as $attr => $value) { |
257 | - $data['@attributes'][$attr] = (string)$value; |
|
257 | + $data['@attributes'][$attr] = (string) $value; |
|
258 | 258 | } |
259 | 259 | |
260 | 260 | if ($totalElement > 1) { |
@@ -91,13 +91,13 @@ discard block |
||
91 | 91 | } |
92 | 92 | |
93 | 93 | $entry['active'] = false; |
94 | - if(!isset($entry['icon'])) { |
|
94 | + if (!isset($entry['icon'])) { |
|
95 | 95 | $entry['icon'] = ''; |
96 | 96 | } |
97 | - if(!isset($entry['classes'])) { |
|
97 | + if (!isset($entry['classes'])) { |
|
98 | 98 | $entry['classes'] = ''; |
99 | 99 | } |
100 | - if(!isset($entry['type'])) { |
|
100 | + if (!isset($entry['type'])) { |
|
101 | 101 | $entry['type'] = 'link'; |
102 | 102 | } |
103 | 103 | $this->entries[$entry['id']] = $entry; |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | ]); |
230 | 230 | |
231 | 231 | $logoutUrl = \OC_User::getLogoutUrl($this->urlGenerator); |
232 | - if($logoutUrl !== '') { |
|
232 | + if ($logoutUrl !== '') { |
|
233 | 233 | // Logout |
234 | 234 | $this->add([ |
235 | 235 | 'type' => 'settings', |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | continue; |
287 | 287 | } |
288 | 288 | $l = $this->l10nFac->get($app); |
289 | - $id = $nav['id'] ?? $app . ($key === 0 ? '' : $key); |
|
289 | + $id = $nav['id'] ?? $app.($key === 0 ? '' : $key); |
|
290 | 290 | $order = isset($nav['order']) ? $nav['order'] : 100; |
291 | 291 | $type = isset($nav['type']) ? $nav['type'] : 'link'; |
292 | 292 | $route = $nav['route'] !== '' ? $this->urlGenerator->linkToRoute($nav['route']) : ''; |
@@ -52,13 +52,13 @@ discard block |
||
52 | 52 | throw new \Exception("Access Key, Secret and Bucket have to be configured."); |
53 | 53 | } |
54 | 54 | |
55 | - $this->id = 'amazon::' . $params['bucket']; |
|
55 | + $this->id = 'amazon::'.$params['bucket']; |
|
56 | 56 | |
57 | 57 | $this->test = isset($params['test']); |
58 | 58 | $this->bucket = $params['bucket']; |
59 | 59 | $this->timeout = !isset($params['timeout']) ? 15 : $params['timeout']; |
60 | 60 | $params['region'] = empty($params['region']) ? 'eu-west-1' : $params['region']; |
61 | - $params['hostname'] = empty($params['hostname']) ? 's3.' . $params['region'] . '.amazonaws.com' : $params['hostname']; |
|
61 | + $params['hostname'] = empty($params['hostname']) ? 's3.'.$params['region'].'.amazonaws.com' : $params['hostname']; |
|
62 | 62 | if (!isset($params['port']) || $params['port'] === '') { |
63 | 63 | $params['port'] = (isset($params['use_ssl']) && $params['use_ssl'] === false) ? 80 : 443; |
64 | 64 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | } |
79 | 79 | |
80 | 80 | $scheme = (isset($this->params['use_ssl']) && $this->params['use_ssl'] === false) ? 'http' : 'https'; |
81 | - $base_url = $scheme . '://' . $this->params['hostname'] . ':' . $this->params['port'] . '/'; |
|
81 | + $base_url = $scheme.'://'.$this->params['hostname'].':'.$this->params['port'].'/'; |
|
82 | 82 | |
83 | 83 | $options = [ |
84 | 84 | 'version' => isset($this->params['version']) ? $this->params['version'] : 'latest', |
@@ -101,16 +101,16 @@ discard block |
||
101 | 101 | |
102 | 102 | if (!$this->connection->isBucketDnsCompatible($this->bucket)) { |
103 | 103 | $logger = \OC::$server->getLogger(); |
104 | - $logger->debug('Bucket "' . $this->bucket . '" This bucket name is not dns compatible, it may contain invalid characters.', |
|
104 | + $logger->debug('Bucket "'.$this->bucket.'" This bucket name is not dns compatible, it may contain invalid characters.', |
|
105 | 105 | ['app' => 'objectstore']); |
106 | 106 | } |
107 | 107 | |
108 | 108 | if (!$this->connection->doesBucketExist($this->bucket)) { |
109 | 109 | $logger = \OC::$server->getLogger(); |
110 | 110 | try { |
111 | - $logger->info('Bucket "' . $this->bucket . '" does not exist - creating it.', ['app' => 'objectstore']); |
|
111 | + $logger->info('Bucket "'.$this->bucket.'" does not exist - creating it.', ['app' => 'objectstore']); |
|
112 | 112 | if (!$this->connection->isBucketDnsCompatible($this->bucket)) { |
113 | - throw new \Exception("The bucket will not be created because the name is not dns compatible, please correct it: " . $this->bucket); |
|
113 | + throw new \Exception("The bucket will not be created because the name is not dns compatible, please correct it: ".$this->bucket); |
|
114 | 114 | } |
115 | 115 | $this->connection->createBucket(array('Bucket' => $this->bucket)); |
116 | 116 | $this->testTimeout(); |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | 'level' => ILogger::DEBUG, |
121 | 121 | 'app' => 'objectstore', |
122 | 122 | ]); |
123 | - throw new \Exception('Creation of bucket "' . $this->bucket . '" failed. ' . $e->getMessage()); |
|
123 | + throw new \Exception('Creation of bucket "'.$this->bucket.'" failed. '.$e->getMessage()); |
|
124 | 124 | } |
125 | 125 | } |
126 | 126 |
@@ -40,10 +40,10 @@ discard block |
||
40 | 40 | |
41 | 41 | $resourceManager->invalidateAccessCacheForUser($user); |
42 | 42 | }; |
43 | - $dispatcher->addListener(IGroup::class . '::postAddUser', $listener); |
|
44 | - $dispatcher->addListener(IGroup::class . '::postRemoveUser', $listener); |
|
43 | + $dispatcher->addListener(IGroup::class.'::postAddUser', $listener); |
|
44 | + $dispatcher->addListener(IGroup::class.'::postRemoveUser', $listener); |
|
45 | 45 | |
46 | - $dispatcher->addListener(IUser::class . '::postDelete', function(GenericEvent $event) { |
|
46 | + $dispatcher->addListener(IUser::class.'::postDelete', function(GenericEvent $event) { |
|
47 | 47 | /** @var IUser $user */ |
48 | 48 | $user = $event->getSubject(); |
49 | 49 | /** @var IManager $resourceManager */ |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | $resourceManager->invalidateAccessCacheForUser($user); |
53 | 53 | }); |
54 | 54 | |
55 | - $dispatcher->addListener(IGroup::class . '::preDelete', function(GenericEvent $event) { |
|
55 | + $dispatcher->addListener(IGroup::class.'::preDelete', function(GenericEvent $event) { |
|
56 | 56 | /** @var IGroup $group */ |
57 | 57 | $group = $event->getSubject(); |
58 | 58 | /** @var IManager $resourceManager */ |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | return; |
147 | 147 | } |
148 | 148 | |
149 | - $this->dispatcher->dispatch(IGroup::class . '::preAddUser', new GenericEvent($this, [ |
|
149 | + $this->dispatcher->dispatch(IGroup::class.'::preAddUser', new GenericEvent($this, [ |
|
150 | 150 | 'user' => $user, |
151 | 151 | ])); |
152 | 152 | |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $this->users[$user->getUID()] = $user; |
161 | 161 | } |
162 | 162 | |
163 | - $this->dispatcher->dispatch(IGroup::class . '::postAddUser', new GenericEvent($this, [ |
|
163 | + $this->dispatcher->dispatch(IGroup::class.'::postAddUser', new GenericEvent($this, [ |
|
164 | 164 | 'user' => $user, |
165 | 165 | ])); |
166 | 166 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | */ |
180 | 180 | public function removeUser($user) { |
181 | 181 | $result = false; |
182 | - $this->dispatcher->dispatch(IGroup::class . '::preRemoveUser', new GenericEvent($this, [ |
|
182 | + $this->dispatcher->dispatch(IGroup::class.'::preRemoveUser', new GenericEvent($this, [ |
|
183 | 183 | 'user' => $user, |
184 | 184 | ])); |
185 | 185 | if ($this->emitter) { |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | } |
193 | 193 | } |
194 | 194 | if ($result) { |
195 | - $this->dispatcher->dispatch(IGroup::class . '::postRemoveUser', new GenericEvent($this, [ |
|
195 | + $this->dispatcher->dispatch(IGroup::class.'::postRemoveUser', new GenericEvent($this, [ |
|
196 | 196 | 'user' => $user, |
197 | 197 | ])); |
198 | 198 | if ($this->emitter) { |
@@ -238,8 +238,8 @@ discard block |
||
238 | 238 | public function count($search = '') { |
239 | 239 | $users = false; |
240 | 240 | foreach ($this->backends as $backend) { |
241 | - if($backend->implementsActions(\OC\Group\Backend::COUNT_USERS)) { |
|
242 | - if($users === false) { |
|
241 | + if ($backend->implementsActions(\OC\Group\Backend::COUNT_USERS)) { |
|
242 | + if ($users === false) { |
|
243 | 243 | //we could directly add to a bool variable, but this would |
244 | 244 | //be ugly |
245 | 245 | $users = 0; |
@@ -258,8 +258,8 @@ discard block |
||
258 | 258 | public function countDisabled() { |
259 | 259 | $users = false; |
260 | 260 | foreach ($this->backends as $backend) { |
261 | - if($backend instanceOf ICountDisabledInGroup) { |
|
262 | - if($users === false) { |
|
261 | + if ($backend instanceOf ICountDisabledInGroup) { |
|
262 | + if ($users === false) { |
|
263 | 263 | //we could directly add to a bool variable, but this would |
264 | 264 | //be ugly |
265 | 265 | $users = 0; |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | } |
303 | 303 | |
304 | 304 | $result = false; |
305 | - $this->dispatcher->dispatch(IGroup::class . '::preDelete', new GenericEvent($this)); |
|
305 | + $this->dispatcher->dispatch(IGroup::class.'::preDelete', new GenericEvent($this)); |
|
306 | 306 | if ($this->emitter) { |
307 | 307 | $this->emitter->emit('\OC\Group', 'preDelete', array($this)); |
308 | 308 | } |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | } |
314 | 314 | } |
315 | 315 | if ($result) { |
316 | - $this->dispatcher->dispatch(IGroup::class . '::postDelete', new GenericEvent($this)); |
|
316 | + $this->dispatcher->dispatch(IGroup::class.'::postDelete', new GenericEvent($this)); |
|
317 | 317 | if ($this->emitter) { |
318 | 318 | $this->emitter->emit('\OC\Group', 'postDelete', array($this)); |
319 | 319 | } |
@@ -164,12 +164,12 @@ discard block |
||
164 | 164 | } |
165 | 165 | |
166 | 166 | $user = $params['user']; |
167 | - $this->id = 'swift::' . $user . md5($params['bucket']); |
|
167 | + $this->id = 'swift::'.$user.md5($params['bucket']); |
|
168 | 168 | |
169 | 169 | $bucketUrl = new Uri($params['bucket']); |
170 | 170 | if ($bucketUrl->getHost()) { |
171 | 171 | $params['bucket'] = basename($bucketUrl->getPath()); |
172 | - $params['endpoint_url'] = (string)$bucketUrl->withPath(dirname($bucketUrl->getPath())); |
|
172 | + $params['endpoint_url'] = (string) $bucketUrl->withPath(dirname($bucketUrl->getPath())); |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | if (empty($params['url'])) { |
@@ -258,16 +258,16 @@ discard block |
||
258 | 258 | continue; |
259 | 259 | } |
260 | 260 | |
261 | - if ($this->is_dir($path . '/' . $file)) { |
|
262 | - $this->rmdir($path . '/' . $file); |
|
261 | + if ($this->is_dir($path.'/'.$file)) { |
|
262 | + $this->rmdir($path.'/'.$file); |
|
263 | 263 | } else { |
264 | - $this->unlink($path . '/' . $file); |
|
264 | + $this->unlink($path.'/'.$file); |
|
265 | 265 | } |
266 | 266 | } |
267 | 267 | |
268 | 268 | try { |
269 | - $this->objectStore->deleteObject($path . '/'); |
|
270 | - $this->objectCache->remove($path . '/'); |
|
269 | + $this->objectStore->deleteObject($path.'/'); |
|
270 | + $this->objectCache->remove($path.'/'); |
|
271 | 271 | } catch (BadResponseError $e) { |
272 | 272 | \OC::$server->getLogger()->logException($e, [ |
273 | 273 | 'level' => ILogger::ERROR, |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | } |
351 | 351 | |
352 | 352 | $stat = array(); |
353 | - $stat['size'] = (int)$object->contentLength; |
|
353 | + $stat['size'] = (int) $object->contentLength; |
|
354 | 354 | $stat['mtime'] = $mtime; |
355 | 355 | $stat['atime'] = time(); |
356 | 356 | return $stat; |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | try { |
383 | 383 | $this->objectStore->deleteObject($path); |
384 | 384 | $this->objectCache->remove($path); |
385 | - $this->objectCache->remove($path . '/'); |
|
385 | + $this->objectCache->remove($path.'/'); |
|
386 | 386 | } catch (BadResponseError $e) { |
387 | 387 | if ($e->getResponse()->getStatusCode() !== 404) { |
388 | 388 | \OC::$server->getLogger()->logException($e, [ |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | file_put_contents($tmpFile, $source); |
441 | 441 | } |
442 | 442 | $handle = fopen($tmpFile, $mode); |
443 | - return CallbackWrapper::wrap($handle, null, null, function () use ($path, $tmpFile) { |
|
443 | + return CallbackWrapper::wrap($handle, null, null, function() use ($path, $tmpFile) { |
|
444 | 444 | $this->writeBack($tmpFile, $path); |
445 | 445 | }); |
446 | 446 | } |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | if (is_null($mtime)) { |
452 | 452 | $mtime = time(); |
453 | 453 | } |
454 | - $metadata = ['timestamp' => (string)$mtime]; |
|
454 | + $metadata = ['timestamp' => (string) $mtime]; |
|
455 | 455 | if ($this->file_exists($path)) { |
456 | 456 | if ($this->is_dir($path) && $path !== '.') { |
457 | 457 | $path .= '/'; |
@@ -490,11 +490,11 @@ discard block |
||
490 | 490 | try { |
491 | 491 | $source = $this->fetchObject($path1); |
492 | 492 | $source->copy([ |
493 | - 'destination' => $this->bucket . '/' . $path2 |
|
493 | + 'destination' => $this->bucket.'/'.$path2 |
|
494 | 494 | ]); |
495 | 495 | // invalidate target object to force repopulation on fetch |
496 | 496 | $this->objectCache->remove($path2); |
497 | - $this->objectCache->remove($path2 . '/'); |
|
497 | + $this->objectCache->remove($path2.'/'); |
|
498 | 498 | } catch (BadResponseError $e) { |
499 | 499 | \OC::$server->getLogger()->logException($e, [ |
500 | 500 | 'level' => ILogger::ERROR, |
@@ -505,13 +505,13 @@ discard block |
||
505 | 505 | |
506 | 506 | } else if ($fileType === 'dir') { |
507 | 507 | try { |
508 | - $source = $this->fetchObject($path1 . '/'); |
|
508 | + $source = $this->fetchObject($path1.'/'); |
|
509 | 509 | $source->copy([ |
510 | - 'destination' => $this->bucket . '/' . $path2 . '/' |
|
510 | + 'destination' => $this->bucket.'/'.$path2.'/' |
|
511 | 511 | ]); |
512 | 512 | // invalidate target object to force repopulation on fetch |
513 | 513 | $this->objectCache->remove($path2); |
514 | - $this->objectCache->remove($path2 . '/'); |
|
514 | + $this->objectCache->remove($path2.'/'); |
|
515 | 515 | } catch (BadResponseError $e) { |
516 | 516 | \OC::$server->getLogger()->logException($e, [ |
517 | 517 | 'level' => ILogger::ERROR, |
@@ -526,8 +526,8 @@ discard block |
||
526 | 526 | continue; |
527 | 527 | } |
528 | 528 | |
529 | - $source = $path1 . '/' . $file; |
|
530 | - $target = $path2 . '/' . $file; |
|
529 | + $source = $path1.'/'.$file; |
|
530 | + $target = $path2.'/'.$file; |
|
531 | 531 | $this->copy($source, $target); |
532 | 532 | } |
533 | 533 | |
@@ -608,7 +608,7 @@ discard block |
||
608 | 608 | $path = ''; |
609 | 609 | } |
610 | 610 | $cachedContent = $this->getCache()->getFolderContents($path); |
611 | - $cachedNames = array_map(function ($content) { |
|
611 | + $cachedNames = array_map(function($content) { |
|
612 | 612 | return $content['name']; |
613 | 613 | }, $cachedContent); |
614 | 614 | sort($cachedNames); |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | $this->server->on('propPatch', array($this, 'handleUpdateProperties')); |
174 | 174 | $this->server->on('afterBind', array($this, 'sendFileIdHeader')); |
175 | 175 | $this->server->on('afterWriteContent', array($this, 'sendFileIdHeader')); |
176 | - $this->server->on('afterMethod:GET', [$this,'httpGet']); |
|
176 | + $this->server->on('afterMethod:GET', [$this, 'httpGet']); |
|
177 | 177 | $this->server->on('afterMethod:GET', array($this, 'handleDownloadToken')); |
178 | 178 | $this->server->on('afterResponse', function($request, ResponseInterface $response) { |
179 | 179 | $body = $response->getBody(); |
@@ -203,11 +203,11 @@ discard block |
||
203 | 203 | if ($sourceDir !== $destinationDir) { |
204 | 204 | $sourceNodeFileInfo = $sourceNode->getFileInfo(); |
205 | 205 | if ($sourceNodeFileInfo === null) { |
206 | - throw new NotFound($source . ' does not exist'); |
|
206 | + throw new NotFound($source.' does not exist'); |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | if (!$sourceNodeFileInfo->isDeletable()) { |
210 | - throw new Forbidden($source . " cannot be deleted"); |
|
210 | + throw new Forbidden($source." cannot be deleted"); |
|
211 | 211 | } |
212 | 212 | } |
213 | 213 | } |
@@ -260,10 +260,10 @@ discard block |
||
260 | 260 | Request::USER_AGENT_ANDROID_MOBILE_CHROME, |
261 | 261 | Request::USER_AGENT_FREEBOX, |
262 | 262 | ])) { |
263 | - $response->addHeader('Content-Disposition', 'attachment; filename="' . rawurlencode($filename) . '"'); |
|
263 | + $response->addHeader('Content-Disposition', 'attachment; filename="'.rawurlencode($filename).'"'); |
|
264 | 264 | } else { |
265 | - $response->addHeader('Content-Disposition', 'attachment; filename*=UTF-8\'\'' . rawurlencode($filename) |
|
266 | - . '; filename="' . rawurlencode($filename) . '"'); |
|
265 | + $response->addHeader('Content-Disposition', 'attachment; filename*=UTF-8\'\''.rawurlencode($filename) |
|
266 | + . '; filename="'.rawurlencode($filename).'"'); |
|
267 | 267 | } |
268 | 268 | } |
269 | 269 | |
@@ -352,13 +352,13 @@ discard block |
||
352 | 352 | } |
353 | 353 | }); |
354 | 354 | |
355 | - $propFind->handle(self::HAS_PREVIEW_PROPERTYNAME, function () use ($node) { |
|
355 | + $propFind->handle(self::HAS_PREVIEW_PROPERTYNAME, function() use ($node) { |
|
356 | 356 | return json_encode($this->previewManager->isAvailable($node->getFileInfo())); |
357 | 357 | }); |
358 | 358 | $propFind->handle(self::SIZE_PROPERTYNAME, function() use ($node) { |
359 | 359 | return $node->getSize(); |
360 | 360 | }); |
361 | - $propFind->handle(self::MOUNT_TYPE_PROPERTYNAME, function () use ($node) { |
|
361 | + $propFind->handle(self::MOUNT_TYPE_PROPERTYNAME, function() use ($node) { |
|
362 | 362 | return $node->getFileInfo()->getMountPoint()->getMountType(); |
363 | 363 | }); |
364 | 364 | |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | list($path, $name) = \Sabre\Uri\split($filePath); |
484 | 484 | $info = \OC_FileChunking::decodeName($name); |
485 | 485 | if (!empty($info)) { |
486 | - $filePath = $path . '/' . $info['name']; |
|
486 | + $filePath = $path.'/'.$info['name']; |
|
487 | 487 | } |
488 | 488 | } |
489 | 489 |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | public static function computerFileSize($str) { |
99 | 99 | $str = strtolower($str); |
100 | 100 | if (is_numeric($str)) { |
101 | - return (float)$str; |
|
101 | + return (float) $str; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | $bytes_array = array( |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | 'p' => 1024 * 1024 * 1024 * 1024 * 1024, |
116 | 116 | ); |
117 | 117 | |
118 | - $bytes = (float)$str; |
|
118 | + $bytes = (float) $str; |
|
119 | 119 | |
120 | 120 | if (preg_match('#([kmgtp]?b?)$#si', $str, $matches) && !empty($bytes_array[$matches[1]])) { |
121 | 121 | $bytes *= $bytes_array[$matches[1]]; |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | } |
230 | 230 | foreach ($dirs as $dir) { |
231 | 231 | foreach ($exts as $ext) { |
232 | - if ($check_fn("$dir/$name" . $ext)) |
|
232 | + if ($check_fn("$dir/$name".$ext)) |
|
233 | 233 | return true; |
234 | 234 | } |
235 | 235 | } |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | $ext = ''; |
301 | 301 | } |
302 | 302 | |
303 | - $newpath = $path . '/' . $filename; |
|
303 | + $newpath = $path.'/'.$filename; |
|
304 | 304 | if ($view->file_exists($newpath)) { |
305 | 305 | if (preg_match_all('/\((\d+)\)/', $name, $matches, PREG_OFFSET_CAPTURE)) { |
306 | 306 | //Replace the last "(number)" with "(number+1)" |
@@ -316,11 +316,11 @@ discard block |
||
316 | 316 | do { |
317 | 317 | if ($offset) { |
318 | 318 | //Replace the last "(number)" with "(number+1)" |
319 | - $newname = substr_replace($name, '(' . $counter . ')', $offset, $match_length); |
|
319 | + $newname = substr_replace($name, '('.$counter.')', $offset, $match_length); |
|
320 | 320 | } else { |
321 | - $newname = $name . ' (' . $counter . ')'; |
|
321 | + $newname = $name.' ('.$counter.')'; |
|
322 | 322 | } |
323 | - $newpath = $path . '/' . $newname . $ext; |
|
323 | + $newpath = $path.'/'.$newname.$ext; |
|
324 | 324 | $counter++; |
325 | 325 | } while ($view->file_exists($newpath)); |
326 | 326 | } |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | * @return int number of bytes representing |
384 | 384 | */ |
385 | 385 | public static function maxUploadFilesize($dir, $freeSpace = null) { |
386 | - if (is_null($freeSpace) || $freeSpace < 0){ |
|
386 | + if (is_null($freeSpace) || $freeSpace < 0) { |
|
387 | 387 | $freeSpace = self::freeSpace($dir); |
388 | 388 | } |
389 | 389 | return min($freeSpace, self::uploadLimit()); |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | $freeSpace = max($freeSpace, 0); |
402 | 402 | return $freeSpace; |
403 | 403 | } else { |
404 | - return (INF > 0)? INF: PHP_INT_MAX; // work around https://bugs.php.net/bug.php?id=69188 |
|
404 | + return (INF > 0) ? INF: PHP_INT_MAX; // work around https://bugs.php.net/bug.php?id=69188 |
|
405 | 405 | } |
406 | 406 | } |
407 | 407 | |
@@ -414,9 +414,9 @@ discard block |
||
414 | 414 | $ini = \OC::$server->getIniWrapper(); |
415 | 415 | $upload_max_filesize = OCP\Util::computerFileSize($ini->get('upload_max_filesize')); |
416 | 416 | $post_max_size = OCP\Util::computerFileSize($ini->get('post_max_size')); |
417 | - if ((int)$upload_max_filesize === 0 and (int)$post_max_size === 0) { |
|
417 | + if ((int) $upload_max_filesize === 0 and (int) $post_max_size === 0) { |
|
418 | 418 | return INF; |
419 | - } elseif ((int)$upload_max_filesize === 0 or (int)$post_max_size === 0) { |
|
419 | + } elseif ((int) $upload_max_filesize === 0 or (int) $post_max_size === 0) { |
|
420 | 420 | return max($upload_max_filesize, $post_max_size); //only the non 0 value counts |
421 | 421 | } else { |
422 | 422 | return min($upload_max_filesize, $post_max_size); |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | $ownerId = $storage->getOwner($path); |
544 | 544 | $ownerDisplayName = ''; |
545 | 545 | $owner = \OC::$server->getUserManager()->get($ownerId); |
546 | - if($owner) { |
|
546 | + if ($owner) { |
|
547 | 547 | $ownerDisplayName = $owner->getDisplayName(); |
548 | 548 | } |
549 | 549 |
@@ -389,7 +389,7 @@ |
||
389 | 389 | foreach ($ak as $source) { |
390 | 390 | $tags = $this->subTags[$source]; |
391 | 391 | foreach ($tags as $tag) { |
392 | - $subTags[] = $source . '_' . $tag; |
|
392 | + $subTags[] = $source.'_'.$tag; |
|
393 | 393 | } |
394 | 394 | } |
395 | 395 |