Completed
Pull Request — master (#4212)
by Individual IT
13:52
created
apps/files/lib/Controller/ViewController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 	protected function renderScript($appName, $scriptName) {
110 110
 		$content = '';
111 111
 		$appPath = \OC_App::getAppPath($appName);
112
-		$scriptPath = $appPath . '/' . $scriptName;
112
+		$scriptPath = $appPath.'/'.$scriptName;
113 113
 		if (file_exists($scriptPath)) {
114 114
 			// TODO: sanitize path / script name ?
115 115
 			ob_start();
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 		$this->eventDispatcher->dispatch('OCA\Files::loadAdditionalScripts');
227 227
 
228 228
 		$params = [];
229
-		$params['usedSpacePercent'] = (int)$storageInfo['relative'];
229
+		$params['usedSpacePercent'] = (int) $storageInfo['relative'];
230 230
 		$params['owner'] = $storageInfo['owner'];
231 231
 		$params['ownerDisplayName'] = $storageInfo['ownerDisplayName'];
232 232
 		$params['isPublic'] = false;
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 		$params = [];
267 267
 
268 268
 		if (empty($files) && $this->appManager->isEnabledForUser('files_trashbin')) {
269
-			$baseFolder = $this->rootFolder->get($uid . '/files_trashbin/files/');
269
+			$baseFolder = $this->rootFolder->get($uid.'/files_trashbin/files/');
270 270
 			$files = $baseFolder->getById($fileId);
271 271
 			$params['view'] = 'trashbin';
272 272
 		}
Please login to merge, or discard this patch.
apps/files/lib/Controller/ApiController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 	 * @return DataResponse|FileDisplayResponse
107 107
 	 */
108 108
 	public function getThumbnail($x, $y, $file) {
109
-		if($x < 1 || $y < 1) {
109
+		if ($x < 1 || $y < 1) {
110 110
 			return new DataResponse(['message' => 'Requested size must be numeric and a positive value.'], Http::STATUS_BAD_REQUEST);
111 111
 		}
112 112
 
@@ -167,13 +167,13 @@  discard block
 block discarded – undo
167 167
 	 * @return array
168 168
 	 */
169 169
 	private function formatNodes(array $nodes) {
170
-		return array_values(array_map(function (Node $node) {
170
+		return array_values(array_map(function(Node $node) {
171 171
 			/** @var \OC\Files\Node\Node $shareTypes */
172 172
 			$shareTypes = $this->getShareTypes($node);
173 173
 			$file = \OCA\Files\Helper::formatFileInfo($node->getFileInfo());
174 174
 			$parts = explode('/', dirname($node->getPath()), 4);
175 175
 			if (isset($parts[3])) {
176
-				$file['path'] = '/' . $parts[3];
176
+				$file['path'] = '/'.$parts[3];
177 177
 			} else {
178 178
 				$file['path'] = '/';
179 179
 			}
Please login to merge, or discard this patch.
apps/files/lib/AppInfo/Application.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 use OCA\Files\Controller\ViewController;
32 32
 
33 33
 class Application extends App {
34
-	public function __construct(array $urlParams=array()) {
34
+	public function __construct(array $urlParams = array()) {
35 35
 		parent::__construct('files', $urlParams);
36 36
 		$container = $this->getContainer();
37 37
 		$server = $container->getServer();
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 		/**
40 40
 		 * Controllers
41 41
 		 */
42
-		$container->registerService('APIController', function (IContainer $c) use ($server) {
42
+		$container->registerService('APIController', function(IContainer $c) use ($server) {
43 43
 			return new ApiController(
44 44
 				$c->query('AppName'),
45 45
 				$c->query('Request'),
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 			);
53 53
 		});
54 54
 
55
-		$container->registerService('ViewController', function (IContainer $c) use ($server) {
55
+		$container->registerService('ViewController', function(IContainer $c) use ($server) {
56 56
 			return new ViewController(
57 57
 				$c->query('AppName'),
58 58
 				$c->query('Request'),
@@ -76,10 +76,10 @@  discard block
 block discarded – undo
76 76
 		/**
77 77
 		 * Services
78 78
 		 */
79
-		$container->registerService('Tagger', function(IContainer $c)  {
79
+		$container->registerService('Tagger', function(IContainer $c) {
80 80
 			return $c->query('ServerContainer')->getTagManager()->load('files');
81 81
 		});
82
-		$container->registerService('TagService', function(IContainer $c)  {
82
+		$container->registerService('TagService', function(IContainer $c) {
83 83
 			$homeFolder = $c->query('ServerContainer')->getUserFolder();
84 84
 			return new TagService(
85 85
 				$c->query('ServerContainer')->getUserSession(),
Please login to merge, or discard this patch.
apps/files/lib/Helper.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 			'uploadMaxFilesize' => $maxUploadFileSize,
55 55
 			'maxHumanFilesize'  => $maxHumanFileSize,
56 56
 			'freeSpace' => $storageInfo['free'],
57
-			'usedSpacePercent'  => (int)$storageInfo['relative'],
57
+			'usedSpacePercent'  => (int) $storageInfo['relative'],
58 58
 			'owner' => $storageInfo['owner'],
59 59
 			'ownerDisplayName' => $storageInfo['ownerDisplayName'],
60 60
 		];
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	 * @return string icon URL
68 68
 	 */
69 69
 	public static function determineIcon($file) {
70
-		if($file['type'] === 'dir') {
70
+		if ($file['type'] === 'dir') {
71 71
 			$icon = \OC::$server->getMimeTypeDetector()->mimeTypeIcon('dir');
72 72
 			// TODO: move this part to the client side, using mountType
73 73
 			if ($file->isShared()) {
@@ -75,11 +75,11 @@  discard block
 block discarded – undo
75 75
 			} elseif ($file->isMounted()) {
76 76
 				$icon = \OC::$server->getMimeTypeDetector()->mimeTypeIcon('dir-external');
77 77
 			}
78
-		}else{
78
+		} else {
79 79
 			$icon = \OC::$server->getMimeTypeDetector()->mimeTypeIcon($file->getMimetype());
80 80
 		}
81 81
 
82
-		return substr($icon, 0, -3) . 'svg';
82
+		return substr($icon, 0, -3).'svg';
83 83
 	}
84 84
 
85 85
 	/**
Please login to merge, or discard this patch.
apps/files/lib/BackgroundJob/CleanupFileLocks.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
 	 */
52 52
 	public function run($argument) {
53 53
 		$lockingProvider = \OC::$server->getLockingProvider();
54
-		if($lockingProvider instanceof DBLockingProvider) {
54
+		if ($lockingProvider instanceof DBLockingProvider) {
55 55
 			$lockingProvider->cleanExpiredLocks();
56 56
 		}
57 57
 	}
Please login to merge, or discard this patch.
apps/files/lib/BackgroundJob/DeleteOrphanedItems.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -80,12 +80,12 @@
 block discarded – undo
80 80
 		$deletedEntries = 0;
81 81
 
82 82
 		$query = $this->connection->getQueryBuilder();
83
-		$query->select('t1.' . $idCol)
83
+		$query->select('t1.'.$idCol)
84 84
 			->from($table, 't1')
85 85
 			->where($query->expr()->eq($typeCol, $query->expr()->literal('files')))
86 86
 			->andWhere($query->expr()->isNull('t2.fileid'))
87
-			->leftJoin('t1', 'filecache', 't2', $query->expr()->eq($query->expr()->castColumn('t1.' . $idCol, IQueryBuilder::PARAM_INT), 't2.fileid'))
88
-			->groupBy('t1.' . $idCol)
87
+			->leftJoin('t1', 'filecache', 't2', $query->expr()->eq($query->expr()->castColumn('t1.'.$idCol, IQueryBuilder::PARAM_INT), 't2.fileid'))
88
+			->groupBy('t1.'.$idCol)
89 89
 			->setMaxResults(self::CHUNK_SIZE);
90 90
 
91 91
 		$deleteQuery = $this->connection->getQueryBuilder();
Please login to merge, or discard this patch.
apps/files/lib/Settings/Admin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
 		$maxUploadFilesize = Util::humanFileSize(min($upload_max_filesize, $post_max_size));
56 56
 
57 57
 		$parameters = [
58
-			'uploadChangable'              => (($htaccessWorking and $htaccessWritable) or $userIniWritable ),
58
+			'uploadChangable'              => (($htaccessWorking and $htaccessWritable) or $userIniWritable),
59 59
 			'uploadMaxFilesize'            => $maxUploadFilesize,
60 60
 			// max possible makes only sense on a 32 bit system
61 61
 			'displayMaxPossibleUploadSize' => PHP_INT_SIZE === 4,
Please login to merge, or discard this patch.
apps/files/download.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,15 +29,15 @@  discard block
 block discarded – undo
29 29
 
30 30
 $filename = $_GET["file"];
31 31
 
32
-if(!\OC\Files\Filesystem::file_exists($filename)) {
32
+if (!\OC\Files\Filesystem::file_exists($filename)) {
33 33
 	header("HTTP/1.0 404 Not Found");
34
-	$tmpl = new OCP\Template( '', '404', 'guest' );
34
+	$tmpl = new OCP\Template('', '404', 'guest');
35 35
 	$tmpl->assign('file', $filename);
36 36
 	$tmpl->printPage();
37 37
 	exit;
38 38
 }
39 39
 
40
-$ftype=\OC::$server->getMimeTypeDetector()->getSecureMimeType(\OC\Files\Filesystem::getMimeType( $filename ));
40
+$ftype = \OC::$server->getMimeTypeDetector()->getSecureMimeType(\OC\Files\Filesystem::getMimeType($filename));
41 41
 
42 42
 header('Content-Type:'.$ftype);
43 43
 OCP\Response::setContentDispositionHeader(basename($filename), 'attachment');
@@ -45,4 +45,4 @@  discard block
 block discarded – undo
45 45
 OCP\Response::setContentLengthHeader(\OC\Files\Filesystem::filesize($filename));
46 46
 
47 47
 OC_Util::obEnd();
48
-\OC\Files\Filesystem::readfile( $filename );
48
+\OC\Files\Filesystem::readfile($filename);
Please login to merge, or discard this patch.
apps/files/appinfo/app.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 $templateManager->registerTemplate('application/vnd.oasis.opendocument.text', 'core/templates/filetemplates/template.odt');
39 39
 $templateManager->registerTemplate('application/vnd.oasis.opendocument.spreadsheet', 'core/templates/filetemplates/template.ods');
40 40
 
41
-\OCA\Files\App::getNavigationManager()->add(function () use ($l) {
41
+\OCA\Files\App::getNavigationManager()->add(function() use ($l) {
42 42
 	return [
43 43
 		'id' => 'files',
44 44
 		'appname' => 'files',
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	];
49 49
 });
50 50
 
51
-\OCA\Files\App::getNavigationManager()->add(function () use ($l) {
51
+\OCA\Files\App::getNavigationManager()->add(function() use ($l) {
52 52
 	return [
53 53
 		'id' => 'recent',
54 54
 		'appname' => 'files',
Please login to merge, or discard this patch.