@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | // exit if we can't create a new file and we don't updatable existing file |
| 127 | 127 | $chunkInfo = \OC_FileChunking::decodeName($name); |
| 128 | 128 | if (!$this->fileView->isCreatable($this->path) && |
| 129 | - !$this->fileView->isUpdatable($this->path . '/' . $chunkInfo['name']) |
|
| 129 | + !$this->fileView->isUpdatable($this->path.'/'.$chunkInfo['name']) |
|
| 130 | 130 | ) { |
| 131 | 131 | throw new \Sabre\DAV\Exception\Forbidden(); |
| 132 | 132 | } |
@@ -140,9 +140,9 @@ discard block |
||
| 140 | 140 | |
| 141 | 141 | $this->fileView->verifyPath($this->path, $name); |
| 142 | 142 | |
| 143 | - $path = $this->fileView->getAbsolutePath($this->path) . '/' . $name; |
|
| 143 | + $path = $this->fileView->getAbsolutePath($this->path).'/'.$name; |
|
| 144 | 144 | // in case the file already exists/overwriting |
| 145 | - $info = $this->fileView->getFileInfo($this->path . '/' . $name); |
|
| 145 | + $info = $this->fileView->getFileInfo($this->path.'/'.$name); |
|
| 146 | 146 | if (!$info) { |
| 147 | 147 | // use a dummy FileInfo which is acceptable here since it will be refreshed after the put is complete |
| 148 | 148 | $info = new \OC\Files\FileInfo($path, null, null, [], null); |
@@ -151,11 +151,11 @@ discard block |
||
| 151 | 151 | |
| 152 | 152 | // only allow 1 process to upload a file at once but still allow reading the file while writing the part file |
| 153 | 153 | $node->acquireLock(ILockingProvider::LOCK_SHARED); |
| 154 | - $this->fileView->lockFile($path . '.upload.part', ILockingProvider::LOCK_EXCLUSIVE); |
|
| 154 | + $this->fileView->lockFile($path.'.upload.part', ILockingProvider::LOCK_EXCLUSIVE); |
|
| 155 | 155 | |
| 156 | 156 | $result = $node->put($data); |
| 157 | 157 | |
| 158 | - $this->fileView->unlockFile($path . '.upload.part', ILockingProvider::LOCK_EXCLUSIVE); |
|
| 158 | + $this->fileView->unlockFile($path.'.upload.part', ILockingProvider::LOCK_EXCLUSIVE); |
|
| 159 | 159 | $node->releaseLock(ILockingProvider::LOCK_SHARED); |
| 160 | 160 | return $result; |
| 161 | 161 | } catch (\OCP\Files\StorageNotAvailableException $e) { |
@@ -185,9 +185,9 @@ discard block |
||
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | $this->fileView->verifyPath($this->path, $name); |
| 188 | - $newPath = $this->path . '/' . $name; |
|
| 188 | + $newPath = $this->path.'/'.$name; |
|
| 189 | 189 | if (!$this->fileView->mkdir($newPath)) { |
| 190 | - throw new \Sabre\DAV\Exception\Forbidden('Could not create directory ' . $newPath); |
|
| 190 | + throw new \Sabre\DAV\Exception\Forbidden('Could not create directory '.$newPath); |
|
| 191 | 191 | } |
| 192 | 192 | } catch (\OCP\Files\StorageNotAvailableException $e) { |
| 193 | 193 | throw new \Sabre\DAV\Exception\ServiceUnavailable($e->getMessage()); |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | throw new NotFound(); |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | - $path = $this->path . '/' . $name; |
|
| 219 | + $path = $this->path.'/'.$name; |
|
| 220 | 220 | if (is_null($info)) { |
| 221 | 221 | try { |
| 222 | 222 | $this->fileView->verifyPath($this->path, $name); |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | if (!$info) { |
| 234 | - throw new \Sabre\DAV\Exception\NotFound('File with name ' . $path . ' could not be located'); |
|
| 234 | + throw new \Sabre\DAV\Exception\NotFound('File with name '.$path.' could not be located'); |
|
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | if ($info['mimetype'] === 'httpd/unix-directory') { |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | // (required old code) instead of "updateFile". |
| 291 | 291 | // |
| 292 | 292 | // TODO: resolve chunk file name here and implement "updateFile" |
| 293 | - $path = $this->path . '/' . $name; |
|
| 293 | + $path = $this->path.'/'.$name; |
|
| 294 | 294 | return $this->fileView->file_exists($path); |
| 295 | 295 | |
| 296 | 296 | } |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | throw new ServiceUnavailable('filesystem not setup'); |
| 386 | 386 | } |
| 387 | 387 | |
| 388 | - $destinationPath = $this->getPath() . '/' . $targetName; |
|
| 388 | + $destinationPath = $this->getPath().'/'.$targetName; |
|
| 389 | 389 | |
| 390 | 390 | |
| 391 | 391 | $targetNodeExists = $this->childExists($targetName); |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | // at getNodeForPath we also check the path for isForbiddenFileOrDir |
| 394 | 394 | // with that we have covered both source and destination |
| 395 | 395 | if ($sourceNode instanceof Directory && $targetNodeExists) { |
| 396 | - throw new \Sabre\DAV\Exception\Forbidden('Could not copy directory ' . $sourceNode->getName() . ', target exists'); |
|
| 396 | + throw new \Sabre\DAV\Exception\Forbidden('Could not copy directory '.$sourceNode->getName().', target exists'); |
|
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | list($sourceDir,) = \Sabre\Uri\split($sourceNode->getPath()); |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $appName = $input->getArgument('app'); |
| 114 | 114 | $version = $input->getArgument('version'); |
| 115 | 115 | |
| 116 | - if (!preg_match('/^\d{1,16}$/',$version)) { |
|
| 116 | + if (!preg_match('/^\d{1,16}$/', $version)) { |
|
| 117 | 117 | $output->writeln('<error>The given version is invalid. Only 0-9 are allowed (max. 16 digits)</error>'); |
| 118 | 118 | return 1; |
| 119 | 119 | } |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $ms = new MigrationService($appName, $this->connection, new ConsoleOutput($output)); |
| 122 | 122 | |
| 123 | 123 | $date = date('YmdHis'); |
| 124 | - $path = $this->generateMigration($ms, 'Version' . $version . 'Date' . $date); |
|
| 124 | + $path = $this->generateMigration($ms, 'Version'.$version.'Date'.$date); |
|
| 125 | 125 | |
| 126 | 126 | $output->writeln("New migration class has been generated to <info>$path</info>"); |
| 127 | 127 | return 0; |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | $appName = $context->getWordAtIndex($context->getWordIndex() - 1); |
| 152 | 152 | |
| 153 | 153 | $version = explode('.', $this->appManager->getAppVersion($appName)); |
| 154 | - return [$version[0] . sprintf('%1$03d', $version[1])]; |
|
| 154 | + return [$version[0].sprintf('%1$03d', $version[1])]; |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | return []; |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | */ |
| 166 | 166 | protected function generateMigration(MigrationService $ms, $className, $schemaBody = '') { |
| 167 | 167 | if ($schemaBody === '') { |
| 168 | - $schemaBody = "\t\t" . 'return null;'; |
|
| 168 | + $schemaBody = "\t\t".'return null;'; |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | $dir = $ms->getMigrationsDirectory(); |
| 184 | 184 | |
| 185 | 185 | $this->ensureMigrationDirExists($dir); |
| 186 | - $path = $dir . '/' . $className . '.php'; |
|
| 186 | + $path = $dir.'/'.$className.'.php'; |
|
| 187 | 187 | |
| 188 | 188 | if (file_put_contents($path, $code) === false) { |
| 189 | 189 | throw new RuntimeException('Failed to generate new migration step.'); |
@@ -134,7 +134,7 @@ |
||
| 134 | 134 | } else if ($existing === 'exclusive') { |
| 135 | 135 | return $existing; |
| 136 | 136 | } else { |
| 137 | - return $existing . ' shared locks'; |
|
| 137 | + return $existing.' shared locks'; |
|
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | 140 | } |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | } |
| 329 | 329 | if ($lock) { |
| 330 | 330 | if ($this->storage->instanceOfStorage('\OCP\Files\Storage\ILockingStorage')) { |
| 331 | - $this->storage->acquireLock('scanner::' . $path, ILockingProvider::LOCK_EXCLUSIVE, $this->lockingProvider); |
|
| 331 | + $this->storage->acquireLock('scanner::'.$path, ILockingProvider::LOCK_EXCLUSIVE, $this->lockingProvider); |
|
| 332 | 332 | $this->storage->acquireLock($path, ILockingProvider::LOCK_SHARED, $this->lockingProvider); |
| 333 | 333 | } |
| 334 | 334 | } |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | if ($lock) { |
| 343 | 343 | if ($this->storage->instanceOfStorage('\OCP\Files\Storage\ILockingStorage')) { |
| 344 | 344 | $this->storage->releaseLock($path, ILockingProvider::LOCK_SHARED, $this->lockingProvider); |
| 345 | - $this->storage->releaseLock('scanner::' . $path, ILockingProvider::LOCK_EXCLUSIVE, $this->lockingProvider); |
|
| 345 | + $this->storage->releaseLock('scanner::'.$path, ILockingProvider::LOCK_EXCLUSIVE, $this->lockingProvider); |
|
| 346 | 346 | } |
| 347 | 347 | } |
| 348 | 348 | } |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | $exceptionOccurred = false; |
| 433 | 433 | $childQueue = []; |
| 434 | 434 | foreach ($newChildren as $file) { |
| 435 | - $child = $path ? $path . '/' . $file : $file; |
|
| 435 | + $child = $path ? $path.'/'.$file : $file; |
|
| 436 | 436 | try { |
| 437 | 437 | $existingData = isset($existingChildren[$file]) ? $existingChildren[$file] : null; |
| 438 | 438 | $data = $this->scanFile($child, $reuse, $folderId, $existingData, $lock); |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | \OC::$server->getDatabaseConnection()->beginTransaction(); |
| 458 | 458 | } |
| 459 | 459 | \OC::$server->getLogger()->logException($ex, [ |
| 460 | - 'message' => 'Exception while scanning file "' . $child . '"', |
|
| 460 | + 'message' => 'Exception while scanning file "'.$child.'"', |
|
| 461 | 461 | 'level' => ILogger::DEBUG, |
| 462 | 462 | 'app' => 'core', |
| 463 | 463 | ]); |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | } |
| 472 | 472 | $removedChildren = \array_diff(array_keys($existingChildren), $newChildren); |
| 473 | 473 | foreach ($removedChildren as $childName) { |
| 474 | - $child = $path ? $path . '/' . $childName : $childName; |
|
| 474 | + $child = $path ? $path.'/'.$childName : $childName; |
|
| 475 | 475 | $this->removeFromCache($child); |
| 476 | 476 | } |
| 477 | 477 | if ($this->useTransactions) { |
@@ -511,13 +511,13 @@ discard block |
||
| 511 | 511 | */ |
| 512 | 512 | public function backgroundScan() { |
| 513 | 513 | if (!$this->cache->inCache('')) { |
| 514 | - $this->runBackgroundScanJob(function () { |
|
| 514 | + $this->runBackgroundScanJob(function() { |
|
| 515 | 515 | $this->scan('', self::SCAN_RECURSIVE, self::REUSE_ETAG); |
| 516 | 516 | }, ''); |
| 517 | 517 | } else { |
| 518 | 518 | $lastPath = null; |
| 519 | 519 | while (($path = $this->cache->getIncomplete()) !== false && $path !== $lastPath) { |
| 520 | - $this->runBackgroundScanJob(function () use ($path) { |
|
| 520 | + $this->runBackgroundScanJob(function() use ($path) { |
|
| 521 | 521 | $this->scan($path, self::SCAN_RECURSIVE_INCOMPLETE, self::REUSE_ETAG | self::REUSE_SIZE); |
| 522 | 522 | }, $path); |
| 523 | 523 | // FIXME: this won't proceed with the next item, needs revamping of getIncomplete() |
@@ -50,13 +50,13 @@ discard block |
||
| 50 | 50 | * @since 7.0.0 |
| 51 | 51 | * @deprecated 14.0.0 Move over to QBMapper |
| 52 | 52 | */ |
| 53 | - public function __construct(IDBConnection $db, $tableName, $entityClass=null){ |
|
| 53 | + public function __construct(IDBConnection $db, $tableName, $entityClass = null) { |
|
| 54 | 54 | $this->db = $db; |
| 55 | - $this->tableName = '*PREFIX*' . $tableName; |
|
| 55 | + $this->tableName = '*PREFIX*'.$tableName; |
|
| 56 | 56 | |
| 57 | 57 | // if not given set the entity name to the class without the mapper part |
| 58 | 58 | // cache it here for later use since reflection is slow |
| 59 | - if($entityClass === null) { |
|
| 59 | + if ($entityClass === null) { |
|
| 60 | 60 | $this->entityClass = str_replace('Mapper', '', get_class($this)); |
| 61 | 61 | } else { |
| 62 | 62 | $this->entityClass = $entityClass; |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | * @since 7.0.0 |
| 70 | 70 | * @deprecated 14.0.0 Move over to QBMapper |
| 71 | 71 | */ |
| 72 | - public function getTableName(){ |
|
| 72 | + public function getTableName() { |
|
| 73 | 73 | return $this->tableName; |
| 74 | 74 | } |
| 75 | 75 | |
@@ -81,8 +81,8 @@ discard block |
||
| 81 | 81 | * @since 7.0.0 - return value added in 8.1.0 |
| 82 | 82 | * @deprecated 14.0.0 Move over to QBMapper |
| 83 | 83 | */ |
| 84 | - public function delete(Entity $entity){ |
|
| 85 | - $sql = 'DELETE FROM `' . $this->tableName . '` WHERE `id` = ?'; |
|
| 84 | + public function delete(Entity $entity) { |
|
| 85 | + $sql = 'DELETE FROM `'.$this->tableName.'` WHERE `id` = ?'; |
|
| 86 | 86 | $stmt = $this->execute($sql, [$entity->getId()]); |
| 87 | 87 | $stmt->closeCursor(); |
| 88 | 88 | return $entity; |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | * @since 7.0.0 |
| 97 | 97 | * @deprecated 14.0.0 Move over to QBMapper |
| 98 | 98 | */ |
| 99 | - public function insert(Entity $entity){ |
|
| 99 | + public function insert(Entity $entity) { |
|
| 100 | 100 | // get updated fields to save, fields have to be set using a setter to |
| 101 | 101 | // be saved |
| 102 | 102 | $properties = $entity->getUpdatedFields(); |
@@ -106,15 +106,15 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | // build the fields |
| 108 | 108 | $i = 0; |
| 109 | - foreach($properties as $property => $updated) { |
|
| 109 | + foreach ($properties as $property => $updated) { |
|
| 110 | 110 | $column = $entity->propertyToColumn($property); |
| 111 | - $getter = 'get' . ucfirst($property); |
|
| 111 | + $getter = 'get'.ucfirst($property); |
|
| 112 | 112 | |
| 113 | - $columns .= '`' . $column . '`'; |
|
| 113 | + $columns .= '`'.$column.'`'; |
|
| 114 | 114 | $values .= '?'; |
| 115 | 115 | |
| 116 | 116 | // only append colon if there are more entries |
| 117 | - if($i < count($properties)-1){ |
|
| 117 | + if ($i < count($properties) - 1) { |
|
| 118 | 118 | $columns .= ','; |
| 119 | 119 | $values .= ','; |
| 120 | 120 | } |
@@ -124,8 +124,8 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | - $sql = 'INSERT INTO `' . $this->tableName . '`(' . |
|
| 128 | - $columns . ') VALUES(' . $values . ')'; |
|
| 127 | + $sql = 'INSERT INTO `'.$this->tableName.'`('. |
|
| 128 | + $columns.') VALUES('.$values.')'; |
|
| 129 | 129 | |
| 130 | 130 | $stmt = $this->execute($sql, $params); |
| 131 | 131 | |
@@ -146,16 +146,16 @@ discard block |
||
| 146 | 146 | * @since 7.0.0 - return value was added in 8.0.0 |
| 147 | 147 | * @deprecated 14.0.0 Move over to QBMapper |
| 148 | 148 | */ |
| 149 | - public function update(Entity $entity){ |
|
| 149 | + public function update(Entity $entity) { |
|
| 150 | 150 | // if entity wasn't changed it makes no sense to run a db query |
| 151 | 151 | $properties = $entity->getUpdatedFields(); |
| 152 | - if(count($properties) === 0) { |
|
| 152 | + if (count($properties) === 0) { |
|
| 153 | 153 | return $entity; |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | // entity needs an id |
| 157 | 157 | $id = $entity->getId(); |
| 158 | - if($id === null){ |
|
| 158 | + if ($id === null) { |
|
| 159 | 159 | throw new \InvalidArgumentException( |
| 160 | 160 | 'Entity which should be updated has no id'); |
| 161 | 161 | } |
@@ -170,15 +170,15 @@ discard block |
||
| 170 | 170 | |
| 171 | 171 | // build the fields |
| 172 | 172 | $i = 0; |
| 173 | - foreach($properties as $property => $updated) { |
|
| 173 | + foreach ($properties as $property => $updated) { |
|
| 174 | 174 | |
| 175 | 175 | $column = $entity->propertyToColumn($property); |
| 176 | - $getter = 'get' . ucfirst($property); |
|
| 176 | + $getter = 'get'.ucfirst($property); |
|
| 177 | 177 | |
| 178 | - $columns .= '`' . $column . '` = ?'; |
|
| 178 | + $columns .= '`'.$column.'` = ?'; |
|
| 179 | 179 | |
| 180 | 180 | // only append colon if there are more entries |
| 181 | - if($i < count($properties)-1){ |
|
| 181 | + if ($i < count($properties) - 1) { |
|
| 182 | 182 | $columns .= ','; |
| 183 | 183 | } |
| 184 | 184 | |
@@ -186,8 +186,8 @@ discard block |
||
| 186 | 186 | $i++; |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - $sql = 'UPDATE `' . $this->tableName . '` SET ' . |
|
| 190 | - $columns . ' WHERE `id` = ?'; |
|
| 189 | + $sql = 'UPDATE `'.$this->tableName.'` SET '. |
|
| 190 | + $columns.' WHERE `id` = ?'; |
|
| 191 | 191 | $params[] = $id; |
| 192 | 192 | |
| 193 | 193 | $stmt = $this->execute($sql, $params); |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | * @since 7.0.0 |
| 237 | 237 | * @deprecated 14.0.0 Move over to QBMapper |
| 238 | 238 | */ |
| 239 | - protected function execute($sql, array $params=[], $limit=null, $offset=null){ |
|
| 239 | + protected function execute($sql, array $params = [], $limit = null, $offset = null) { |
|
| 240 | 240 | $query = $this->db->prepare($sql, $limit, $offset); |
| 241 | 241 | |
| 242 | 242 | if ($this->isAssocArray($params)) { |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | $query->bindValue($key, $param, $pdoConstant); |
| 246 | 246 | } |
| 247 | 247 | } else { |
| 248 | - $index = 1; // bindParam is 1 indexed |
|
| 248 | + $index = 1; // bindParam is 1 indexed |
|
| 249 | 249 | foreach ($params as $param) { |
| 250 | 250 | $pdoConstant = $this->getPDOType($param); |
| 251 | 251 | $query->bindValue($index, $param, $pdoConstant); |
@@ -272,11 +272,11 @@ discard block |
||
| 272 | 272 | * @since 7.0.0 |
| 273 | 273 | * @deprecated 14.0.0 Move over to QBMapper |
| 274 | 274 | */ |
| 275 | - protected function findOneQuery($sql, array $params=[], $limit=null, $offset=null){ |
|
| 275 | + protected function findOneQuery($sql, array $params = [], $limit = null, $offset = null) { |
|
| 276 | 276 | $stmt = $this->execute($sql, $params, $limit, $offset); |
| 277 | 277 | $row = $stmt->fetch(); |
| 278 | 278 | |
| 279 | - if($row === false || $row === null){ |
|
| 279 | + if ($row === false || $row === null) { |
|
| 280 | 280 | $stmt->closeCursor(); |
| 281 | 281 | $msg = $this->buildDebugMessage( |
| 282 | 282 | 'Did expect one result but found none when executing', $sql, $params, $limit, $offset |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | $row2 = $stmt->fetch(); |
| 287 | 287 | $stmt->closeCursor(); |
| 288 | 288 | //MDB2 returns null, PDO and doctrine false when no row is available |
| 289 | - if( ! ($row2 === false || $row2 === null )) { |
|
| 289 | + if (!($row2 === false || $row2 === null)) { |
|
| 290 | 290 | $msg = $this->buildDebugMessage( |
| 291 | 291 | 'Did not expect more than one result when executing', $sql, $params, $limit, $offset |
| 292 | 292 | ); |
@@ -308,12 +308,12 @@ discard block |
||
| 308 | 308 | * @since 9.1.0 |
| 309 | 309 | * @deprecated 14.0.0 Move over to QBMapper |
| 310 | 310 | */ |
| 311 | - private function buildDebugMessage($msg, $sql, array $params=[], $limit=null, $offset=null) { |
|
| 312 | - return $msg . |
|
| 313 | - ': query "' . $sql . '"; ' . |
|
| 314 | - 'parameters ' . print_r($params, true) . '; ' . |
|
| 315 | - 'limit "' . $limit . '"; '. |
|
| 316 | - 'offset "' . $offset . '"'; |
|
| 311 | + private function buildDebugMessage($msg, $sql, array $params = [], $limit = null, $offset = null) { |
|
| 312 | + return $msg. |
|
| 313 | + ': query "'.$sql.'"; '. |
|
| 314 | + 'parameters '.print_r($params, true).'; '. |
|
| 315 | + 'limit "'.$limit.'"; '. |
|
| 316 | + 'offset "'.$offset.'"'; |
|
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | * @deprecated 14.0.0 Move over to QBMapper |
| 327 | 327 | */ |
| 328 | 328 | protected function mapRowToEntity($row) { |
| 329 | - return call_user_func($this->entityClass .'::fromRow', $row); |
|
| 329 | + return call_user_func($this->entityClass.'::fromRow', $row); |
|
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | |
@@ -340,12 +340,12 @@ discard block |
||
| 340 | 340 | * @since 7.0.0 |
| 341 | 341 | * @deprecated 14.0.0 Move over to QBMapper |
| 342 | 342 | */ |
| 343 | - protected function findEntities($sql, array $params=[], $limit=null, $offset=null) { |
|
| 343 | + protected function findEntities($sql, array $params = [], $limit = null, $offset = null) { |
|
| 344 | 344 | $stmt = $this->execute($sql, $params, $limit, $offset); |
| 345 | 345 | |
| 346 | 346 | $entities = []; |
| 347 | 347 | |
| 348 | - while($row = $stmt->fetch()){ |
|
| 348 | + while ($row = $stmt->fetch()) { |
|
| 349 | 349 | $entities[] = $this->mapRowToEntity($row); |
| 350 | 350 | } |
| 351 | 351 | |
@@ -368,7 +368,7 @@ discard block |
||
| 368 | 368 | * @since 7.0.0 |
| 369 | 369 | * @deprecated 14.0.0 Move over to QBMapper |
| 370 | 370 | */ |
| 371 | - protected function findEntity($sql, array $params=[], $limit=null, $offset=null){ |
|
| 371 | + protected function findEntity($sql, array $params = [], $limit = null, $offset = null) { |
|
| 372 | 372 | return $this->mapRowToEntity($this->findOneQuery($sql, $params, $limit, $offset)); |
| 373 | 373 | } |
| 374 | 374 | |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | public function __construct($action) { |
| 33 | 33 | $l = \OC::$server->getL10N('federation'); |
| 34 | - $message = 'Action "' . $action . '" not supported or implemented.'; |
|
| 34 | + $message = 'Action "'.$action.'" not supported or implemented.'; |
|
| 35 | 35 | $hint = $l->t('Action "%s" not supported or implemented.', [$action]); |
| 36 | 36 | parent::__construct($message, $hint); |
| 37 | 37 | } |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | try { |
| 58 | - $folder = $this->appData->getFolder((string)$node->getId()); |
|
| 58 | + $folder = $this->appData->getFolder((string) $node->getId()); |
|
| 59 | 59 | $folder->delete(); |
| 60 | 60 | } catch (NotFoundException $e) { |
| 61 | 61 | //Nothing to do |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | public function connectWatcher() { |
| 58 | 58 | // Do not connect if we are not setup yet! |
| 59 | 59 | if ($this->config->getValue('instanceid', null) !== null) { |
| 60 | - $this->root->listen('\OC\Files', 'postWrite', function (Node $node) { |
|
| 60 | + $this->root->listen('\OC\Files', 'postWrite', function(Node $node) { |
|
| 61 | 61 | $this->getWatcher()->postWrite($node); |
| 62 | 62 | }); |
| 63 | 63 | |
@@ -162,7 +162,7 @@ |
||
| 162 | 162 | if (\is_array($scope)) { |
| 163 | 163 | parent::setScope(json_encode($scope)); |
| 164 | 164 | } else { |
| 165 | - parent::setScope((string)$scope); |
|
| 165 | + parent::setScope((string) $scope); |
|
| 166 | 166 | } |
| 167 | 167 | } |
| 168 | 168 | |