| @@ -109,7 +109,7 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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 | } | 
| @@ -106,7 +106,7 @@ discard block | ||
| 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 | ||
| 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 | } | 
| @@ -31,7 +31,7 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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(), | 
| @@ -51,7 +51,7 @@ | ||
| 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 | } | 
| @@ -80,12 +80,12 @@ | ||
| 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(); | 
| @@ -55,7 +55,7 @@ | ||
| 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, | 
| @@ -29,15 +29,15 @@ discard block | ||
| 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 | ||
| 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); | |
| @@ -38,7 +38,7 @@ discard block | ||
| 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 | ||
| 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', | 
| @@ -41,12 +41,12 @@ discard block | ||
| 41 | 41 | */ | 
| 42 | 42 | public function __construct(IClientService $clientService = null, | 
| 43 | 43 |  								IJobList $jobList = null) { | 
| 44 | -		if($clientService !== null) { | |
| 44 | +		if ($clientService !== null) { | |
| 45 | 45 | $this->clientService = $clientService; | 
| 46 | 46 |  		} else { | 
| 47 | 47 | $this->clientService = \OC::$server->getHTTPClientService(); | 
| 48 | 48 | } | 
| 49 | -		if($jobList !== null) { | |
| 49 | +		if ($jobList !== null) { | |
| 50 | 50 | $this->jobList = $jobList; | 
| 51 | 51 |  		} else { | 
| 52 | 52 | $this->jobList = \OC::$server->getJobList(); | 
| @@ -54,7 +54,7 @@ discard block | ||
| 54 | 54 | } | 
| 55 | 55 | |
| 56 | 56 |  	protected function run($argument) { | 
| 57 | -		if($argument['retryNo'] === 5) { | |
| 57 | +		if ($argument['retryNo'] === 5) { | |
| 58 | 58 | return; | 
| 59 | 59 | } | 
| 60 | 60 | |