@@ -60,7 +60,7 @@ |
||
| 60 | 60 | $capabilities = array_replace_recursive($capabilities, $c->getCapabilities()); |
| 61 | 61 | } |
| 62 | 62 | } else { |
| 63 | - throw new \InvalidArgumentException('The given Capability (' . get_class($c) . ') does not implement the ICapability interface'); |
|
| 63 | + throw new \InvalidArgumentException('The given Capability ('.get_class($c).') does not implement the ICapability interface'); |
|
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
@@ -135,7 +135,7 @@ |
||
| 135 | 135 | * @return $this |
| 136 | 136 | */ |
| 137 | 137 | public function addHeader($name, $value) { |
| 138 | - $name = trim($name); // always remove leading and trailing whitespace |
|
| 138 | + $name = trim($name); // always remove leading and trailing whitespace |
|
| 139 | 139 | // to be able to reliably check for security |
| 140 | 140 | // headers |
| 141 | 141 | |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | * @return int|null |
| 152 | 152 | */ |
| 153 | 153 | public function getId() { |
| 154 | - return isset($this->data['fileid']) ? (int) $this->data['fileid'] : null; |
|
| 154 | + return isset($this->data['fileid']) ? (int) $this->data['fileid'] : null; |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | /** |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | public function getEtag() { |
| 182 | 182 | $this->updateEntryfromSubMounts(); |
| 183 | 183 | if (count($this->childEtags) > 0) { |
| 184 | - $combinedEtag = $this->data['etag'] . '::' . implode('::', $this->childEtags); |
|
| 184 | + $combinedEtag = $this->data['etag'].'::'.implode('::', $this->childEtags); |
|
| 185 | 185 | return md5($combinedEtag); |
| 186 | 186 | } else { |
| 187 | 187 | return $this->data['etag']; |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | $relativeEntryPath = substr($entryPath, strlen($this->getPath())); |
| 378 | 378 | // attach the permissions to propagate etag on permision changes of submounts |
| 379 | 379 | $permissions = isset($data['permissions']) ? $data['permissions'] : 0; |
| 380 | - $this->childEtags[] = $relativeEntryPath . '/' . $data['etag'] . $permissions; |
|
| 380 | + $this->childEtags[] = $relativeEntryPath.'/'.$data['etag'].$permissions; |
|
| 381 | 381 | } |
| 382 | 382 | } |
| 383 | 383 | |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | public function __construct($arguments) { |
| 51 | 51 | $this->user = $arguments['user']; |
| 52 | 52 | $datadir = $this->user->getHome(); |
| 53 | - $this->id = 'home::' . $this->user->getUID(); |
|
| 53 | + $this->id = 'home::'.$this->user->getUID(); |
|
| 54 | 54 | |
| 55 | 55 | parent::__construct(['datadir' => $datadir]); |
| 56 | 56 | } |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | public function getDirectoryListing() { |
| 50 | 50 | $listing = $this->folder->getDirectoryListing(); |
| 51 | 51 | |
| 52 | - $fileListing = array_map(function (Node $file) { |
|
| 52 | + $fileListing = array_map(function(Node $file) { |
|
| 53 | 53 | if ($file instanceof File) { |
| 54 | 54 | return new SimpleFile($file); |
| 55 | 55 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | * @param array $params |
| 34 | 34 | */ |
| 35 | 35 | public function __construct($params) { |
| 36 | - if (! isset($params['user']) || ! $params['user'] instanceof User) { |
|
| 36 | + if (!isset($params['user']) || !$params['user'] instanceof User) { |
|
| 37 | 37 | throw new \Exception('missing user object in parameters'); |
| 38 | 38 | } |
| 39 | 39 | $this->user = $params['user']; |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | public function getId() { |
| 44 | - return 'object::user:' . $this->user->getUID(); |
|
| 44 | + return 'object::user:'.$this->user->getUID(); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -64,14 +64,14 @@ |
||
| 64 | 64 | if (empty($compare)) { |
| 65 | 65 | $compare = array_keys($input); |
| 66 | 66 | } |
| 67 | - $fieldList = '`' . implode('`,`', array_keys($input)) . '`'; |
|
| 67 | + $fieldList = '`'.implode('`,`', array_keys($input)).'`'; |
|
| 68 | 68 | $query = "INSERT INTO `$table` ($fieldList) SELECT " |
| 69 | 69 | . str_repeat('?,', count($input) - 1).'? ' |
| 70 | 70 | . " WHERE NOT EXISTS (SELECT 1 FROM `$table` WHERE "; |
| 71 | 71 | |
| 72 | 72 | $inserts = array_values($input); |
| 73 | 73 | foreach ($compare as $key) { |
| 74 | - $query .= '`' . $key . '`'; |
|
| 74 | + $query .= '`'.$key.'`'; |
|
| 75 | 75 | if (is_null($input[$key])) { |
| 76 | 76 | $query .= ' IS NULL AND '; |
| 77 | 77 | } else { |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | public function lockTable($tableName) { |
| 68 | 68 | $this->conn->beginTransaction(); |
| 69 | - $this->conn->executeUpdate('LOCK TABLE `' .$tableName . '` IN EXCLUSIVE MODE'); |
|
| 69 | + $this->conn->executeUpdate('LOCK TABLE `'.$tableName.'` IN EXCLUSIVE MODE'); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | /** |
@@ -93,14 +93,14 @@ discard block |
||
| 93 | 93 | if (empty($compare)) { |
| 94 | 94 | $compare = array_keys($input); |
| 95 | 95 | } |
| 96 | - $query = 'INSERT INTO `' .$table . '` (`' |
|
| 97 | - . implode('`,`', array_keys($input)) . '`) SELECT ' |
|
| 96 | + $query = 'INSERT INTO `'.$table.'` (`' |
|
| 97 | + . implode('`,`', array_keys($input)).'`) SELECT ' |
|
| 98 | 98 | . str_repeat('?,', count($input) - 1).'? ' // Is there a prettier alternative? |
| 99 | - . 'FROM `' . $table . '` WHERE '; |
|
| 99 | + . 'FROM `'.$table.'` WHERE '; |
|
| 100 | 100 | |
| 101 | 101 | $inserts = array_values($input); |
| 102 | 102 | foreach ($compare as $key) { |
| 103 | - $query .= '`' . $key . '`'; |
|
| 103 | + $query .= '`'.$key.'`'; |
|
| 104 | 104 | if (is_null($input[$key])) { |
| 105 | 105 | $query .= ' IS NULL AND '; |
| 106 | 106 | } else { |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | * @param string $table table name without the prefix |
| 83 | 83 | */ |
| 84 | 84 | public function dropTable($table) { |
| 85 | - $table = $this->tablePrefix . trim($table); |
|
| 85 | + $table = $this->tablePrefix.trim($table); |
|
| 86 | 86 | $table = $this->quoteIdentifier($table); |
| 87 | 87 | $schema = $this->getSchemaManager(); |
| 88 | 88 | if ($schema->tablesExist([$table])) { |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | * @return bool |
| 98 | 98 | */ |
| 99 | 99 | public function tableExists($table) { |
| 100 | - $table = $this->tablePrefix . trim($table); |
|
| 100 | + $table = $this->tablePrefix.trim($table); |
|
| 101 | 101 | $table = $this->quoteIdentifier($table); |
| 102 | 102 | $schema = $this->getSchemaManager(); |
| 103 | 103 | return $schema->tablesExist([$table]); |