@@ -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 |
@@ -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 | /** |
@@ -51,8 +51,8 @@ |
||
51 | 51 | } |
52 | 52 | if ($entry && $entry['mimetype'] === 'httpd/unix-directory') { |
53 | 53 | $id = $entry['fileid']; |
54 | - $sql = 'SELECT SUM(`size`) AS f1 ' . |
|
55 | - 'FROM `*PREFIX*filecache` ' . |
|
54 | + $sql = 'SELECT SUM(`size`) AS f1 '. |
|
55 | + 'FROM `*PREFIX*filecache` '. |
|
56 | 56 | 'WHERE `parent` = ? AND `storage` = ? AND `size` >= 0'; |
57 | 57 | $result = \OC_DB::executeAudited($sql, [$id, $this->getNumericStorageId()]); |
58 | 58 | if ($row = $result->fetchRow()) { |
@@ -49,7 +49,7 @@ |
||
49 | 49 | * @return null |
50 | 50 | */ |
51 | 51 | public function resynchronizeDatabaseSequences(Connection $conn) { |
52 | - $filterExpression = '/^' . preg_quote($this->config->getSystemValue('dbtableprefix', 'oc_')) . '/'; |
|
52 | + $filterExpression = '/^'.preg_quote($this->config->getSystemValue('dbtableprefix', 'oc_')).'/'; |
|
53 | 53 | $databaseName = $conn->getDatabase(); |
54 | 54 | $conn->getConfiguration()->setFilterSchemaAssetsExpression($filterExpression); |
55 | 55 |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $this->loadTable($schema, $child); |
85 | 85 | break; |
86 | 86 | default: |
87 | - throw new \DomainException('Unknown element: ' . $child->getName()); |
|
87 | + throw new \DomainException('Unknown element: '.$child->getName()); |
|
88 | 88 | |
89 | 89 | } |
90 | 90 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | */ |
105 | 105 | switch ($child->getName()) { |
106 | 106 | case 'name': |
107 | - $name = (string)$child; |
|
107 | + $name = (string) $child; |
|
108 | 108 | $name = str_replace('*dbprefix*', $this->DBTABLEPREFIX, $name); |
109 | 109 | $name = $this->platform->quoteIdentifier($name); |
110 | 110 | $table = $schema->createTable($name); |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $this->loadDeclaration($table, $child); |
121 | 121 | break; |
122 | 122 | default: |
123 | - throw new \DomainException('Unknown element: ' . $child->getName()); |
|
123 | + throw new \DomainException('Unknown element: '.$child->getName()); |
|
124 | 124 | |
125 | 125 | } |
126 | 126 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | $this->loadIndex($table, $child); |
145 | 145 | break; |
146 | 146 | default: |
147 | - throw new \DomainException('Unknown element: ' . $child->getName()); |
|
147 | + throw new \DomainException('Unknown element: '.$child->getName()); |
|
148 | 148 | |
149 | 149 | } |
150 | 150 | } |
@@ -156,18 +156,18 @@ discard block |
||
156 | 156 | * @throws \DomainException |
157 | 157 | */ |
158 | 158 | private function loadField($table, $xml) { |
159 | - $options = [ 'notnull' => false ]; |
|
159 | + $options = ['notnull' => false]; |
|
160 | 160 | foreach ($xml->children() as $child) { |
161 | 161 | /** |
162 | 162 | * @var \SimpleXMLElement $child |
163 | 163 | */ |
164 | 164 | switch ($child->getName()) { |
165 | 165 | case 'name': |
166 | - $name = (string)$child; |
|
166 | + $name = (string) $child; |
|
167 | 167 | $name = $this->platform->quoteIdentifier($name); |
168 | 168 | break; |
169 | 169 | case 'type': |
170 | - $type = (string)$child; |
|
170 | + $type = (string) $child; |
|
171 | 171 | switch ($type) { |
172 | 172 | case 'text': |
173 | 173 | $type = 'string'; |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | } |
185 | 185 | break; |
186 | 186 | case 'length': |
187 | - $length = (string)$child; |
|
187 | + $length = (string) $child; |
|
188 | 188 | $options['length'] = $length; |
189 | 189 | break; |
190 | 190 | case 'unsigned': |
@@ -200,11 +200,11 @@ discard block |
||
200 | 200 | $options['autoincrement'] = $autoincrement; |
201 | 201 | break; |
202 | 202 | case 'default': |
203 | - $default = (string)$child; |
|
203 | + $default = (string) $child; |
|
204 | 204 | $options['default'] = $default; |
205 | 205 | break; |
206 | 206 | case 'comments': |
207 | - $comment = (string)$child; |
|
207 | + $comment = (string) $child; |
|
208 | 208 | $options['comment'] = $comment; |
209 | 209 | break; |
210 | 210 | case 'primary': |
@@ -212,15 +212,15 @@ discard block |
||
212 | 212 | $options['primary'] = $primary; |
213 | 213 | break; |
214 | 214 | case 'precision': |
215 | - $precision = (string)$child; |
|
215 | + $precision = (string) $child; |
|
216 | 216 | $options['precision'] = $precision; |
217 | 217 | break; |
218 | 218 | case 'scale': |
219 | - $scale = (string)$child; |
|
219 | + $scale = (string) $child; |
|
220 | 220 | $options['scale'] = $scale; |
221 | 221 | break; |
222 | 222 | default: |
223 | - throw new \DomainException('Unknown element: ' . $child->getName()); |
|
223 | + throw new \DomainException('Unknown element: '.$child->getName()); |
|
224 | 224 | |
225 | 225 | } |
226 | 226 | } |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | } |
243 | 243 | } |
244 | 244 | if ($type === 'integer' && isset($options['default'])) { |
245 | - $options['default'] = (int)$options['default']; |
|
245 | + $options['default'] = (int) $options['default']; |
|
246 | 246 | } |
247 | 247 | if ($type === 'integer' && isset($options['length'])) { |
248 | 248 | $length = $options['length']; |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | */ |
283 | 283 | switch ($child->getName()) { |
284 | 284 | case 'name': |
285 | - $name = (string)$child; |
|
285 | + $name = (string) $child; |
|
286 | 286 | break; |
287 | 287 | case 'primary': |
288 | 288 | $primary = $this->asBool($child); |
@@ -297,20 +297,20 @@ discard block |
||
297 | 297 | */ |
298 | 298 | switch ($field->getName()) { |
299 | 299 | case 'name': |
300 | - $field_name = (string)$field; |
|
300 | + $field_name = (string) $field; |
|
301 | 301 | $field_name = $this->platform->quoteIdentifier($field_name); |
302 | 302 | $fields[] = $field_name; |
303 | 303 | break; |
304 | 304 | case 'sorting': |
305 | 305 | break; |
306 | 306 | default: |
307 | - throw new \DomainException('Unknown element: ' . $field->getName()); |
|
307 | + throw new \DomainException('Unknown element: '.$field->getName()); |
|
308 | 308 | |
309 | 309 | } |
310 | 310 | } |
311 | 311 | break; |
312 | 312 | default: |
313 | - throw new \DomainException('Unknown element: ' . $child->getName()); |
|
313 | + throw new \DomainException('Unknown element: '.$child->getName()); |
|
314 | 314 | |
315 | 315 | } |
316 | 316 | } |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | } |
329 | 329 | } |
330 | 330 | } else { |
331 | - throw new \DomainException('Empty index definition: ' . $name . ' options:' . print_r($fields, true)); |
|
331 | + throw new \DomainException('Empty index definition: '.$name.' options:'.print_r($fields, true)); |
|
332 | 332 | } |
333 | 333 | } |
334 | 334 | |
@@ -337,12 +337,12 @@ discard block |
||
337 | 337 | * @return bool |
338 | 338 | */ |
339 | 339 | private function asBool($xml) { |
340 | - $result = (string)$xml; |
|
340 | + $result = (string) $xml; |
|
341 | 341 | if ($result == 'true') { |
342 | 342 | $result = true; |
343 | 343 | } elseif ($result == 'false') { |
344 | 344 | $result = false; |
345 | 345 | } |
346 | - return (bool)$result; |
|
346 | + return (bool) $result; |
|
347 | 347 | } |
348 | 348 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function getTableNamesWithoutPrefix() { |
64 | 64 | $tableNames = $this->schema->getTableNames(); |
65 | - return array_map(function ($tableName) { |
|
65 | + return array_map(function($tableName) { |
|
66 | 66 | if (strpos($tableName, $this->connection->getPrefix()) === 0) { |
67 | 67 | return substr($tableName, strlen($this->connection->getPrefix())); |
68 | 68 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * @throws \Doctrine\DBAL\Schema\SchemaException |
81 | 81 | */ |
82 | 82 | public function getTable($tableName) { |
83 | - return $this->schema->getTable($this->connection->getPrefix() . $tableName); |
|
83 | + return $this->schema->getTable($this->connection->getPrefix().$tableName); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * @return boolean |
92 | 92 | */ |
93 | 93 | public function hasTable($tableName) { |
94 | - return $this->schema->hasTable($this->connection->getPrefix() . $tableName); |
|
94 | + return $this->schema->hasTable($this->connection->getPrefix().$tableName); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | * @return \Doctrine\DBAL\Schema\Table |
102 | 102 | */ |
103 | 103 | public function createTable($tableName) { |
104 | - return $this->schema->createTable($this->connection->getPrefix() . $tableName); |
|
104 | + return $this->schema->createTable($this->connection->getPrefix().$tableName); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | */ |
126 | 126 | public function dropTable($tableName) { |
127 | 127 | $this->tablesToDelete[$tableName] = true; |
128 | - return $this->schema->dropTable($this->connection->getPrefix() . $tableName); |
|
128 | + return $this->schema->dropTable($this->connection->getPrefix().$tableName); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
@@ -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]); |