@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | // no point in continuing if the section was not found, use original path |
81 | 81 | return $fullPath; |
82 | 82 | } |
83 | - $path = $convertedPath . '/'; |
|
83 | + $path = $convertedPath.'/'; |
|
84 | 84 | } |
85 | 85 | $path = rtrim($path, '/'); |
86 | 86 | return $path; |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * @return string|null original or converted path, or null if none of the forms was found |
97 | 97 | */ |
98 | 98 | private function findPathToUseLastSection($basePath, $lastSection) { |
99 | - $fullPath = $basePath . $lastSection; |
|
99 | + $fullPath = $basePath.$lastSection; |
|
100 | 100 | if ($lastSection === '' || $this->isAscii($lastSection) || $this->storage->file_exists($fullPath)) { |
101 | 101 | $this->namesCache[$fullPath] = $fullPath; |
102 | 102 | return $fullPath; |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | } else { |
109 | 109 | $otherFormPath = \Normalizer::normalize($lastSection, \Normalizer::FORM_C); |
110 | 110 | } |
111 | - $otherFullPath = $basePath . $otherFormPath; |
|
111 | + $otherFullPath = $basePath.$otherFormPath; |
|
112 | 112 | if ($this->storage->file_exists($otherFullPath)) { |
113 | 113 | $this->namesCache[$fullPath] = $otherFullPath; |
114 | 114 | return $otherFullPath; |
@@ -49,7 +49,7 @@ |
||
49 | 49 | public function __construct($arguments) { |
50 | 50 | $this->user = $arguments['user']; |
51 | 51 | $datadir = $this->user->getHome(); |
52 | - $this->id = 'home::' . $this->user->getUID(); |
|
52 | + $this->id = 'home::'.$this->user->getUID(); |
|
53 | 53 | |
54 | 54 | parent::__construct(array('datadir' => $datadir)); |
55 | 55 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | /** |
29 | 29 | * local storage backend in temporary folder for testing purpose |
30 | 30 | */ |
31 | -class Temporary extends Local{ |
|
31 | +class Temporary extends Local { |
|
32 | 32 | public function __construct($arguments = null) { |
33 | 33 | parent::__construct(array('datadir' => \OC::$server->getTempManager()->getTemporaryFolder())); |
34 | 34 | } |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | if ($this->datadir === '/') { |
59 | 59 | $this->realDataDir = $this->datadir; |
60 | 60 | } else { |
61 | - $this->realDataDir = rtrim(realpath($this->datadir), '/') . '/'; |
|
61 | + $this->realDataDir = rtrim(realpath($this->datadir), '/').'/'; |
|
62 | 62 | } |
63 | 63 | if (substr($this->datadir, -1) !== '/') { |
64 | 64 | $this->datadir .= '/'; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | } |
71 | 71 | |
72 | 72 | public function getId() { |
73 | - return 'local::' . $this->datadir; |
|
73 | + return 'local::'.$this->datadir; |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | public function mkdir($path) { |
@@ -228,17 +228,17 @@ discard block |
||
228 | 228 | $dstParent = dirname($path2); |
229 | 229 | |
230 | 230 | if (!$this->isUpdatable($srcParent)) { |
231 | - \OCP\Util::writeLog('core', 'unable to rename, source directory is not writable : ' . $srcParent, \OCP\Util::ERROR); |
|
231 | + \OCP\Util::writeLog('core', 'unable to rename, source directory is not writable : '.$srcParent, \OCP\Util::ERROR); |
|
232 | 232 | return false; |
233 | 233 | } |
234 | 234 | |
235 | 235 | if (!$this->isUpdatable($dstParent)) { |
236 | - \OCP\Util::writeLog('core', 'unable to rename, destination directory is not writable : ' . $dstParent, \OCP\Util::ERROR); |
|
236 | + \OCP\Util::writeLog('core', 'unable to rename, destination directory is not writable : '.$dstParent, \OCP\Util::ERROR); |
|
237 | 237 | return false; |
238 | 238 | } |
239 | 239 | |
240 | 240 | if (!$this->file_exists($path1)) { |
241 | - \OCP\Util::writeLog('core', 'unable to rename, file does not exists : ' . $path1, \OCP\Util::ERROR); |
|
241 | + \OCP\Util::writeLog('core', 'unable to rename, file does not exists : '.$path1, \OCP\Util::ERROR); |
|
242 | 242 | return false; |
243 | 243 | } |
244 | 244 | |
@@ -319,13 +319,13 @@ discard block |
||
319 | 319 | foreach (scandir($physicalDir) as $item) { |
320 | 320 | if (\OC\Files\Filesystem::isIgnoredDir($item)) |
321 | 321 | continue; |
322 | - $physicalItem = $physicalDir . '/' . $item; |
|
322 | + $physicalItem = $physicalDir.'/'.$item; |
|
323 | 323 | |
324 | 324 | if (strstr(strtolower($item), strtolower($query)) !== false) { |
325 | - $files[] = $dir . '/' . $item; |
|
325 | + $files[] = $dir.'/'.$item; |
|
326 | 326 | } |
327 | 327 | if (is_dir($physicalItem)) { |
328 | - $files = array_merge($files, $this->searchInDir($query, $dir . '/' . $item)); |
|
328 | + $files = array_merge($files, $this->searchInDir($query, $dir.'/'.$item)); |
|
329 | 329 | } |
330 | 330 | } |
331 | 331 | return $files; |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | * @throws ForbiddenException |
355 | 355 | */ |
356 | 356 | public function getSourcePath($path) { |
357 | - $fullPath = $this->datadir . $path; |
|
357 | + $fullPath = $this->datadir.$path; |
|
358 | 358 | if ($this->allowSymlinks || $path === '') { |
359 | 359 | return $fullPath; |
360 | 360 | } |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | $realPath = realpath($pathToResolve); |
366 | 366 | } |
367 | 367 | if ($realPath) { |
368 | - $realPath = $realPath . '/'; |
|
368 | + $realPath = $realPath.'/'; |
|
369 | 369 | } |
370 | 370 | if (substr($realPath, 0, $this->dataDirLength) === $this->realDataDir) { |
371 | 371 | return $fullPath; |
@@ -391,9 +391,9 @@ discard block |
||
391 | 391 | if ($this->is_file($path)) { |
392 | 392 | $stat = $this->stat($path); |
393 | 393 | return md5( |
394 | - $stat['mtime'] . |
|
395 | - $stat['ino'] . |
|
396 | - $stat['dev'] . |
|
394 | + $stat['mtime']. |
|
395 | + $stat['ino']. |
|
396 | + $stat['dev']. |
|
397 | 397 | $stat['size'] |
398 | 398 | ); |
399 | 399 | } else { |
@@ -90,11 +90,11 @@ |
||
90 | 90 | */ |
91 | 91 | public function wrap(IMountPoint $mountPoint, $storage) { |
92 | 92 | $wrappers = array_values($this->storageWrappers); |
93 | - usort($wrappers, function ($a, $b) { |
|
93 | + usort($wrappers, function($a, $b) { |
|
94 | 94 | return $b['priority'] - $a['priority']; |
95 | 95 | }); |
96 | 96 | /** @var callable[] $wrappers */ |
97 | - $wrappers = array_map(function ($wrapper) { |
|
97 | + $wrappers = array_map(function($wrapper) { |
|
98 | 98 | return $wrapper['wrapper']; |
99 | 99 | }, $wrappers); |
100 | 100 | foreach ($wrappers as $wrapper) { |
@@ -89,11 +89,11 @@ |
||
89 | 89 | $result = true; |
90 | 90 | while ($file = readdir($dh)) { |
91 | 91 | if (!\OC\Files\Filesystem::isIgnoredDir($file)) { |
92 | - if ($this->is_dir($source . '/' . $file)) { |
|
93 | - $this->mkdir($target . '/' . $file); |
|
94 | - $result = $this->copyRecursive($source . '/' . $file, $target . '/' . $file); |
|
92 | + if ($this->is_dir($source.'/'.$file)) { |
|
93 | + $this->mkdir($target.'/'.$file); |
|
94 | + $result = $this->copyRecursive($source.'/'.$file, $target.'/'.$file); |
|
95 | 95 | } else { |
96 | - $result = parent::copy($source . '/' . $file, $target . '/' . $file); |
|
96 | + $result = parent::copy($source.'/'.$file, $target.'/'.$file); |
|
97 | 97 | } |
98 | 98 | if (!$result) { |
99 | 99 | break; |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | protected function buildPath($path) { |
59 | - $fullPath = \OC\Files\Filesystem::normalizePath($this->root . '/' . $path); |
|
59 | + $fullPath = \OC\Files\Filesystem::normalizePath($this->root.'/'.$path); |
|
60 | 60 | return ltrim($fullPath, '/'); |
61 | 61 | } |
62 | 62 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | } catch (FileNotFoundException $e) { |
164 | 164 | return false; |
165 | 165 | } |
166 | - $names = array_map(function ($object) { |
|
166 | + $names = array_map(function($object) { |
|
167 | 167 | return $object['basename']; |
168 | 168 | }, $content); |
169 | 169 | return IteratorDirectory::wrap($names); |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $tmpFile = \OCP\Files::tmpFile(); |
210 | 210 | } |
211 | 211 | $source = fopen($tmpFile, $mode); |
212 | - return CallbackWrapper::wrap($source, null, null, function () use ($tmpFile, $fullPath) { |
|
212 | + return CallbackWrapper::wrap($source, null, null, function() use ($tmpFile, $fullPath) { |
|
213 | 213 | $this->flysystem->putStream($fullPath, fopen($tmpFile, 'r')); |
214 | 214 | unlink($tmpFile); |
215 | 215 | }); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | namespace OC\Files\Storage; |
34 | 34 | |
35 | -class CommonTest extends \OC\Files\Storage\Common{ |
|
35 | +class CommonTest extends \OC\Files\Storage\Common { |
|
36 | 36 | /** |
37 | 37 | * underlying local storage used for missing functions |
38 | 38 | * @var \OC\Files\Storage\Local |
@@ -40,10 +40,10 @@ discard block |
||
40 | 40 | private $storage; |
41 | 41 | |
42 | 42 | public function __construct($params) { |
43 | - $this->storage=new \OC\Files\Storage\Local($params); |
|
43 | + $this->storage = new \OC\Files\Storage\Local($params); |
|
44 | 44 | } |
45 | 45 | |
46 | - public function getId(){ |
|
46 | + public function getId() { |
|
47 | 47 | return 'test::'.$this->storage->getId(); |
48 | 48 | } |
49 | 49 | public function mkdir($path) { |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | public function free_space($path) { |
80 | 80 | return $this->storage->free_space($path); |
81 | 81 | } |
82 | - public function touch($path, $mtime=null) { |
|
82 | + public function touch($path, $mtime = null) { |
|
83 | 83 | return $this->storage->touch($path, $mtime); |
84 | 84 | } |
85 | 85 | } |
@@ -69,15 +69,15 @@ discard block |
||
69 | 69 | $this->storageId = self::adjustStorageId($this->storageId); |
70 | 70 | |
71 | 71 | if ($row = self::getStorageById($this->storageId)) { |
72 | - $this->numericId = (int)$row['numeric_id']; |
|
72 | + $this->numericId = (int) $row['numeric_id']; |
|
73 | 73 | } else { |
74 | 74 | $connection = \OC::$server->getDatabaseConnection(); |
75 | 75 | $available = $isAvailable ? 1 : 0; |
76 | 76 | if ($connection->insertIfNotExist('*PREFIX*storages', ['id' => $this->storageId, 'available' => $available])) { |
77 | - $this->numericId = (int)$connection->lastInsertId('*PREFIX*storages'); |
|
77 | + $this->numericId = (int) $connection->lastInsertId('*PREFIX*storages'); |
|
78 | 78 | } else { |
79 | 79 | if ($row = self::getStorageById($this->storageId)) { |
80 | - $this->numericId = (int)$row['numeric_id']; |
|
80 | + $this->numericId = (int) $row['numeric_id']; |
|
81 | 81 | } else { |
82 | 82 | throw new \RuntimeException('Storage could neither be inserted nor be selected from the database'); |
83 | 83 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $storageId = self::adjustStorageId($storageId); |
143 | 143 | |
144 | 144 | if ($row = self::getStorageById($storageId)) { |
145 | - return (int)$row['numeric_id']; |
|
145 | + return (int) $row['numeric_id']; |
|
146 | 146 | } else { |
147 | 147 | return null; |
148 | 148 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | public function getAvailability() { |
155 | 155 | if ($row = self::getStorageById($this->storageId)) { |
156 | 156 | return [ |
157 | - 'available' => ((int)$row['available'] === 1), |
|
157 | + 'available' => ((int) $row['available'] === 1), |
|
158 | 158 | 'last_checked' => $row['last_checked'] |
159 | 159 | ]; |
160 | 160 | } else { |