Passed
Push — master ( 97f2de...4973f9 )
by Roeland
17:00 queued 10s
created
lib/private/Files/Cache/Cache.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -174,21 +174,21 @@  discard block
 block discarded – undo
174 174
 	 */
175 175
 	public static function cacheEntryFromData($data, IMimeTypeLoader $mimetypeLoader) {
176 176
 		//fix types
177
-		$data['fileid'] = (int)$data['fileid'];
178
-		$data['parent'] = (int)$data['parent'];
177
+		$data['fileid'] = (int) $data['fileid'];
178
+		$data['parent'] = (int) $data['parent'];
179 179
 		$data['size'] = 0 + $data['size'];
180
-		$data['mtime'] = (int)$data['mtime'];
181
-		$data['storage_mtime'] = (int)$data['storage_mtime'];
182
-		$data['encryptedVersion'] = (int)$data['encrypted'];
183
-		$data['encrypted'] = (bool)$data['encrypted'];
180
+		$data['mtime'] = (int) $data['mtime'];
181
+		$data['storage_mtime'] = (int) $data['storage_mtime'];
182
+		$data['encryptedVersion'] = (int) $data['encrypted'];
183
+		$data['encrypted'] = (bool) $data['encrypted'];
184 184
 		$data['storage_id'] = $data['storage'];
185
-		$data['storage'] = (int)$data['storage'];
185
+		$data['storage'] = (int) $data['storage'];
186 186
 		$data['mimetype'] = $mimetypeLoader->getMimetypeById($data['mimetype']);
187 187
 		$data['mimepart'] = $mimetypeLoader->getMimetypeById($data['mimepart']);
188 188
 		if ($data['storage_mtime'] == 0) {
189 189
 			$data['storage_mtime'] = $data['mtime'];
190 190
 		}
191
-		$data['permissions'] = (int)$data['permissions'];
191
+		$data['permissions'] = (int) $data['permissions'];
192 192
 		if (isset($data['creation_time'])) {
193 193
 			$data['creation_time'] = (int) $data['creation_time'];
194 194
 		}
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 			$files = $result->fetchAll();
227 227
 			$result->closeCursor();
228 228
 
229
-			return array_map(function (array $data) {
229
+			return array_map(function(array $data) {
230 230
 				return self::cacheEntryFromData($data, $this->mimetypeLoader);
231 231
 			}, $files);
232 232
 		}
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
 
353 353
 			$query->update('filecache')
354 354
 				->whereFileId($id)
355
-				->andWhere($query->expr()->orX(...array_map(function ($key, $value) use ($query) {
355
+				->andWhere($query->expr()->orX(...array_map(function($key, $value) use ($query) {
356 356
 					return $query->expr()->orX(
357 357
 						$query->expr()->neq($key, $query->createNamedParameter($value)),
358 358
 						$query->expr()->isNull($key)
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 				$query = $this->getQueryBuilder();
382 382
 				$query->update('filecache_extended')
383 383
 					->whereFileId($id)
384
-					->andWhere($query->expr()->orX(...array_map(function ($key, $value) use ($query) {
384
+					->andWhere($query->expr()->orX(...array_map(function($key, $value) use ($query) {
385 385
 						return $query->expr()->orX(
386 386
 							$query->expr()->neq($key, $query->createNamedParameter($value)),
387 387
 							$query->expr()->isNull($key)
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
 		$id = $result->fetchColumn();
477 477
 		$result->closeCursor();
478 478
 
479
-		return $id === false ? -1 : (int)$id;
479
+		return $id === false ? -1 : (int) $id;
480 480
 	}
481 481
 
482 482
 	/**
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 			return -1;
491 491
 		} else {
492 492
 			$parent = $this->getParentPath($file);
493
-			return (int)$this->getId($parent);
493
+			return (int) $this->getId($parent);
494 494
 		}
495 495
 	}
496 496
 
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
 	 */
548 548
 	private function getSubFolders(ICacheEntry $entry) {
549 549
 		$children = $this->getFolderContentsById($entry->getId());
550
-		return array_filter($children, function ($child) {
550
+		return array_filter($children, function($child) {
551 551
 			return $child->getMimeType() == FileInfo::MIMETYPE_FOLDER;
552 552
 		});
553 553
 	}
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
 		// and collecting all folder ids to later use to delete the filecache entries
567 567
 		while ($entryId = array_pop($queue)) {
568 568
 			$children = $this->getFolderContentsById($entryId);
569
-			$childIds = array_map(function (ICacheEntry $cacheEntry) {
569
+			$childIds = array_map(function(ICacheEntry $cacheEntry) {
570 570
 				return $cacheEntry->getId();
571 571
 			}, $children);
572 572
 
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 			$query->execute();
577 577
 
578 578
 			/** @var ICacheEntry[] $childFolders */
579
-			$childFolders = array_filter($children, function ($child) {
579
+			$childFolders = array_filter($children, function($child) {
580 580
 				return $child->getMimeType() == FileInfo::MIMETYPE_FOLDER;
581 581
 			});
582 582
 			foreach ($childFolders as $folder) {
@@ -634,10 +634,10 @@  discard block
 block discarded – undo
634 634
 			[$targetStorageId, $targetPath] = $this->getMoveInfo($targetPath);
635 635
 
636 636
 			if (is_null($sourceStorageId) || $sourceStorageId === false) {
637
-				throw new \Exception('Invalid source storage id: ' . $sourceStorageId);
637
+				throw new \Exception('Invalid source storage id: '.$sourceStorageId);
638 638
 			}
639 639
 			if (is_null($targetStorageId) || $targetStorageId === false) {
640
-				throw new \Exception('Invalid target storage id: ' . $targetStorageId);
640
+				throw new \Exception('Invalid target storage id: '.$targetStorageId);
641 641
 			}
642 642
 
643 643
 			$this->connection->beginTransaction();
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
 					->set('path_hash', $fun->md5($newPathFunction))
657 657
 					->set('path', $newPathFunction)
658 658
 					->where($query->expr()->eq('storage', $query->createNamedParameter($sourceStorageId, IQueryBuilder::PARAM_INT)))
659
-					->andWhere($query->expr()->like('path', $query->createNamedParameter($this->connection->escapeLikeParameter($sourcePath) . '/%')));
659
+					->andWhere($query->expr()->like('path', $query->createNamedParameter($this->connection->escapeLikeParameter($sourcePath).'/%')));
660 660
 
661 661
 				try {
662 662
 					$query->execute();
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
 		$result->closeCursor();
725 725
 
726 726
 		if ($size !== false) {
727
-			if ((int)$size === -1) {
727
+			if ((int) $size === -1) {
728 728
 				return self::SHALLOW;
729 729
 			} else {
730 730
 				return self::COMPLETE;
@@ -761,7 +761,7 @@  discard block
 block discarded – undo
761 761
 		$files = $result->fetchAll();
762 762
 		$result->closeCursor();
763 763
 
764
-		return array_map(function (array $data) {
764
+		return array_map(function(array $data) {
765 765
 			return self::cacheEntryFromData($data, $this->mimetypeLoader);
766 766
 		}, $files);
767 767
 	}
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
 	private function searchResultToCacheEntries(Statement $result) {
774 774
 		$files = $result->fetchAll();
775 775
 
776
-		return array_map(function (array $data) {
776
+		return array_map(function(array $data) {
777 777
 			return self::cacheEntryFromData($data, $this->mimetypeLoader);
778 778
 		}, $files);
779 779
 	}
@@ -802,7 +802,7 @@  discard block
 block discarded – undo
802 802
 		$files = $result->fetchAll();
803 803
 		$result->closeCursor();
804 804
 
805
-		return array_map(function (array $data) {
805
+		return array_map(function(array $data) {
806 806
 			return self::cacheEntryFromData($data, $this->mimetypeLoader);
807 807
 		}, $files);
808 808
 	}
@@ -886,7 +886,7 @@  discard block
 block discarded – undo
886 886
 				->andWhere($query->expr()->lt('size', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT)));
887 887
 
888 888
 			$result = $query->execute();
889
-			$size = (int)$result->fetchColumn();
889
+			$size = (int) $result->fetchColumn();
890 890
 			$result->closeCursor();
891 891
 
892 892
 			return $size;
@@ -952,8 +952,8 @@  discard block
 block discarded – undo
952 952
 		$files = $result->fetchAll(\PDO::FETCH_COLUMN);
953 953
 		$result->closeCursor();
954 954
 
955
-		return array_map(function ($id) {
956
-			return (int)$id;
955
+		return array_map(function($id) {
956
+			return (int) $id;
957 957
 		}, $files);
958 958
 	}
959 959
 
Please login to merge, or discard this patch.