@@ -11,9 +11,9 @@ |
||
11 | 11 | <p class="settings-hint"><?php p($l->t('Allows users to share a personalized link to a file or folder by putting in an email address.')); ?></p> |
12 | 12 | |
13 | 13 | <p> |
14 | - <input id="sendPasswordMail" type="checkbox" class="checkbox" <?php if($_['sendPasswordMail']) p('checked'); ?> /> |
|
14 | + <input id="sendPasswordMail" type="checkbox" class="checkbox" <?php if ($_['sendPasswordMail']) p('checked'); ?> /> |
|
15 | 15 | <label for="sendPasswordMail"><?php p($l->t('Send password by mail')); ?></label><br/> |
16 | - <input id="enforcePasswordProtection" type="checkbox" class="checkbox" <?php if($_['enforcePasswordProtection']) p('checked'); ?> /> |
|
16 | + <input id="enforcePasswordProtection" type="checkbox" class="checkbox" <?php if ($_['enforcePasswordProtection']) p('checked'); ?> /> |
|
17 | 17 | <label for="enforcePasswordProtection"><?php p($l->t('Enforce password protection')); ?></label> |
18 | 18 | </p> |
19 | 19 |
@@ -220,9 +220,9 @@ discard block |
||
220 | 220 | )) { |
221 | 221 | // note: pre-fetching only supported for depth <= 1 |
222 | 222 | $folderContent = $node->getChildren(); |
223 | - $fileIds[] = (int)$node->getId(); |
|
223 | + $fileIds[] = (int) $node->getId(); |
|
224 | 224 | foreach ($folderContent as $info) { |
225 | - $fileIds[] = (int)$info->getId(); |
|
225 | + $fileIds[] = (int) $info->getId(); |
|
226 | 226 | } |
227 | 227 | $tags = $this->getTagger()->getTagsForObjects($fileIds); |
228 | 228 | if ($tags === false) { |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | }); |
279 | 279 | |
280 | 280 | $propPatch->handle(self::FAVORITE_PROPERTYNAME, function($favState) use ($node) { |
281 | - if ((int)$favState === 1 || $favState === 'true') { |
|
281 | + if ((int) $favState === 1 || $favState === 'true') { |
|
282 | 282 | $this->getTagger()->tagAs($node->getId(), self::TAG_FAVORITE); |
283 | 283 | } else { |
284 | 284 | $this->getTagger()->unTag($node->getId(), self::TAG_FAVORITE); |
@@ -68,8 +68,8 @@ |
||
68 | 68 | $this->getBundles(), |
69 | 69 | $this->getDefaultInstallationBundle() |
70 | 70 | ); |
71 | - foreach($bundles as $bundle) { |
|
72 | - if($bundle->getIdentifier() === $identifier) { |
|
71 | + foreach ($bundles as $bundle) { |
|
72 | + if ($bundle->getIdentifier() === $identifier) { |
|
73 | 73 | return $bundle; |
74 | 74 | } |
75 | 75 | } |
@@ -55,17 +55,17 @@ |
||
55 | 55 | |
56 | 56 | try { |
57 | 57 | $jobStartTime = time(); |
58 | - $logger->debug('Run ' . get_class($this) . ' job with ID ' . $this->getId(), ['app' => 'cron']); |
|
58 | + $logger->debug('Run '.get_class($this).' job with ID '.$this->getId(), ['app' => 'cron']); |
|
59 | 59 | $this->run($this->argument); |
60 | 60 | $timeTaken = time() - $jobStartTime; |
61 | 61 | |
62 | - $logger->debug('Finished ' . get_class($this) . ' job with ID ' . $this->getId() . ' in ' . $timeTaken . ' seconds', ['app' => 'cron']); |
|
62 | + $logger->debug('Finished '.get_class($this).' job with ID '.$this->getId().' in '.$timeTaken.' seconds', ['app' => 'cron']); |
|
63 | 63 | $jobList->setExecutionTime($this, $timeTaken); |
64 | 64 | } catch (\Exception $e) { |
65 | 65 | if ($logger) { |
66 | 66 | $logger->logException($e, [ |
67 | 67 | 'app' => 'core', |
68 | - 'message' => 'Error while running background job (class: ' . get_class($this) . ', arguments: ' . print_r($this->argument, true) . ')' |
|
68 | + 'message' => 'Error while running background job (class: '.get_class($this).', arguments: '.print_r($this->argument, true).')' |
|
69 | 69 | ]); |
70 | 70 | } |
71 | 71 | } |
@@ -107,32 +107,32 @@ discard block |
||
107 | 107 | case '{DAV:}prop': |
108 | 108 | $newProps['properties'] = array_keys($elem['value']); |
109 | 109 | break; |
110 | - case '{' . SearchPlugin::NS_Nextcloud . '}filter': |
|
110 | + case '{'.SearchPlugin::NS_Nextcloud.'}filter': |
|
111 | 111 | foreach ($elem['value'] as $subElem) { |
112 | - if ($subElem['name'] === '{' . SearchPlugin::NS_Nextcloud . '}comp-filter') { |
|
112 | + if ($subElem['name'] === '{'.SearchPlugin::NS_Nextcloud.'}comp-filter') { |
|
113 | 113 | if (!isset($newProps['filters']['comps']) || !is_array($newProps['filters']['comps'])) { |
114 | 114 | $newProps['filters']['comps'] = []; |
115 | 115 | } |
116 | 116 | $newProps['filters']['comps'][] = $subElem['value']; |
117 | - } elseif ($subElem['name'] === '{' . SearchPlugin::NS_Nextcloud . '}prop-filter') { |
|
117 | + } elseif ($subElem['name'] === '{'.SearchPlugin::NS_Nextcloud.'}prop-filter') { |
|
118 | 118 | if (!isset($newProps['filters']['props']) || !is_array($newProps['filters']['props'])) { |
119 | 119 | $newProps['filters']['props'] = []; |
120 | 120 | } |
121 | 121 | $newProps['filters']['props'][] = $subElem['value']; |
122 | - } elseif ($subElem['name'] === '{' . SearchPlugin::NS_Nextcloud . '}param-filter') { |
|
122 | + } elseif ($subElem['name'] === '{'.SearchPlugin::NS_Nextcloud.'}param-filter') { |
|
123 | 123 | if (!isset($newProps['filters']['params']) || !is_array($newProps['filters']['params'])) { |
124 | 124 | $newProps['filters']['params'] = []; |
125 | 125 | } |
126 | 126 | $newProps['filters']['params'][] = $subElem['value']; |
127 | - } elseif ($subElem['name'] === '{' . SearchPlugin::NS_Nextcloud . '}search-term') { |
|
127 | + } elseif ($subElem['name'] === '{'.SearchPlugin::NS_Nextcloud.'}search-term') { |
|
128 | 128 | $newProps['filters']['search-term'] = $subElem['value']; |
129 | 129 | } |
130 | 130 | } |
131 | 131 | break; |
132 | - case '{' . SearchPlugin::NS_Nextcloud . '}limit': |
|
132 | + case '{'.SearchPlugin::NS_Nextcloud.'}limit': |
|
133 | 133 | $newProps['limit'] = $elem['value']; |
134 | 134 | break; |
135 | - case '{' . SearchPlugin::NS_Nextcloud . '}offset': |
|
135 | + case '{'.SearchPlugin::NS_Nextcloud.'}offset': |
|
136 | 136 | $newProps['offset'] = $elem['value']; |
137 | 137 | break; |
138 | 138 | |
@@ -140,21 +140,21 @@ discard block |
||
140 | 140 | } |
141 | 141 | |
142 | 142 | if (empty($newProps['filters'])) { |
143 | - throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}filter element is required for this request'); |
|
143 | + throw new BadRequest('The {'.SearchPlugin::NS_Nextcloud.'}filter element is required for this request'); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | $propsOrParamsDefined = (!empty($newProps['filters']['props']) || !empty($newProps['filters']['params'])); |
147 | 147 | $noCompsDefined = empty($newProps['filters']['comps']); |
148 | 148 | if ($propsOrParamsDefined && $noCompsDefined) { |
149 | - throw new BadRequest('{' . SearchPlugin::NS_Nextcloud . '}prop-filter or {' . SearchPlugin::NS_Nextcloud . '}param-filter given without any {' . SearchPlugin::NS_Nextcloud . '}comp-filter'); |
|
149 | + throw new BadRequest('{'.SearchPlugin::NS_Nextcloud.'}prop-filter or {'.SearchPlugin::NS_Nextcloud.'}param-filter given without any {'.SearchPlugin::NS_Nextcloud.'}comp-filter'); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | if (!isset($newProps['filters']['search-term'])) { |
153 | - throw new BadRequest('{' . SearchPlugin::NS_Nextcloud . '}search-term is required for this request'); |
|
153 | + throw new BadRequest('{'.SearchPlugin::NS_Nextcloud.'}search-term is required for this request'); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | if (empty($newProps['filters']['props']) && empty($newProps['filters']['params'])) { |
157 | - throw new BadRequest('At least one{' . SearchPlugin::NS_Nextcloud . '}prop-filter or {' . SearchPlugin::NS_Nextcloud . '}param-filter is required for this request'); |
|
157 | + throw new BadRequest('At least one{'.SearchPlugin::NS_Nextcloud.'}prop-filter or {'.SearchPlugin::NS_Nextcloud.'}param-filter is required for this request'); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 |
@@ -27,7 +27,7 @@ |
||
27 | 27 | * {@inheritDoc} |
28 | 28 | */ |
29 | 29 | public function getName() { |
30 | - return (string)$this->l10n->t('Groupware bundle'); |
|
30 | + return (string) $this->l10n->t('Groupware bundle'); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | return parent::connect(); |
59 | 59 | } catch (DBALException $e) { |
60 | 60 | // throw a new exception to prevent leaking info from the stacktrace |
61 | - throw new DBALException('Failed to connect to the database: ' . $e->getMessage(), $e->getCode()); |
|
61 | + throw new DBALException('Failed to connect to the database: '.$e->getMessage(), $e->getCode()); |
|
62 | 62 | } |
63 | 63 | } |
64 | 64 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | // 0 is the method where we use `getCallerBacktrace` |
111 | 111 | // 1 is the target method which uses the method we want to log |
112 | 112 | if (isset($traces[1])) { |
113 | - return $traces[1]['file'] . ':' . $traces[1]['line']; |
|
113 | + return $traces[1]['file'].':'.$traces[1]['line']; |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | return ''; |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | * @param int $offset |
157 | 157 | * @return \Doctrine\DBAL\Driver\Statement The prepared statement. |
158 | 158 | */ |
159 | - public function prepare( $statement, $limit=null, $offset=null ) { |
|
159 | + public function prepare($statement, $limit = null, $offset = null) { |
|
160 | 160 | if ($limit === -1) { |
161 | 161 | $limit = null; |
162 | 162 | } |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | throw new \BadMethodCallException('Can not lock a new table until the previous lock is released.'); |
322 | 322 | } |
323 | 323 | |
324 | - $tableName = $this->tablePrefix . $tableName; |
|
324 | + $tableName = $this->tablePrefix.$tableName; |
|
325 | 325 | $this->lockedTable = $tableName; |
326 | 326 | $this->adapter->lockTable($tableName); |
327 | 327 | } |
@@ -342,11 +342,11 @@ discard block |
||
342 | 342 | * @return string |
343 | 343 | */ |
344 | 344 | public function getError() { |
345 | - $msg = $this->errorCode() . ': '; |
|
345 | + $msg = $this->errorCode().': '; |
|
346 | 346 | $errorInfo = $this->errorInfo(); |
347 | 347 | if (is_array($errorInfo)) { |
348 | - $msg .= 'SQLSTATE = '.$errorInfo[0] . ', '; |
|
349 | - $msg .= 'Driver Code = '.$errorInfo[1] . ', '; |
|
348 | + $msg .= 'SQLSTATE = '.$errorInfo[0].', '; |
|
349 | + $msg .= 'Driver Code = '.$errorInfo[1].', '; |
|
350 | 350 | $msg .= 'Driver Message = '.$errorInfo[2]; |
351 | 351 | } |
352 | 352 | return $msg; |
@@ -358,9 +358,9 @@ discard block |
||
358 | 358 | * @param string $table table name without the prefix |
359 | 359 | */ |
360 | 360 | public function dropTable($table) { |
361 | - $table = $this->tablePrefix . trim($table); |
|
361 | + $table = $this->tablePrefix.trim($table); |
|
362 | 362 | $schema = $this->getSchemaManager(); |
363 | - if($schema->tablesExist(array($table))) { |
|
363 | + if ($schema->tablesExist(array($table))) { |
|
364 | 364 | $schema->dropTable($table); |
365 | 365 | } |
366 | 366 | } |
@@ -371,8 +371,8 @@ discard block |
||
371 | 371 | * @param string $table table name without the prefix |
372 | 372 | * @return bool |
373 | 373 | */ |
374 | - public function tableExists($table){ |
|
375 | - $table = $this->tablePrefix . trim($table); |
|
374 | + public function tableExists($table) { |
|
375 | + $table = $this->tablePrefix.trim($table); |
|
376 | 376 | $schema = $this->getSchemaManager(); |
377 | 377 | return $schema->tablesExist(array($table)); |
378 | 378 | } |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | * @return string |
384 | 384 | */ |
385 | 385 | protected function replaceTablePrefix($statement) { |
386 | - return str_replace( '*PREFIX*', $this->tablePrefix, $statement ); |
|
386 | + return str_replace('*PREFIX*', $this->tablePrefix, $statement); |
|
387 | 387 | } |
388 | 388 | |
389 | 389 | /** |
@@ -42,7 +42,7 @@ |
||
42 | 42 | * @inheritdoc |
43 | 43 | */ |
44 | 44 | public function start($id, $description) { |
45 | - if ($this->activated){ |
|
45 | + if ($this->activated) { |
|
46 | 46 | $this->events[$id] = new Event($id, $description, microtime(true)); |
47 | 47 | } |
48 | 48 | } |
@@ -118,17 +118,17 @@ discard block |
||
118 | 118 | protected function attachListener($mount) { |
119 | 119 | $scanner = $mount->getStorage()->getScanner(); |
120 | 120 | $emitter = $this; |
121 | - $scanner->listen('\OC\Files\Cache\Scanner', 'scanFile', function ($path) use ($mount, $emitter) { |
|
122 | - $emitter->emit('\OC\Files\Utils\Scanner', 'scanFile', array($mount->getMountPoint() . $path)); |
|
121 | + $scanner->listen('\OC\Files\Cache\Scanner', 'scanFile', function($path) use ($mount, $emitter) { |
|
122 | + $emitter->emit('\OC\Files\Utils\Scanner', 'scanFile', array($mount->getMountPoint().$path)); |
|
123 | 123 | }); |
124 | - $scanner->listen('\OC\Files\Cache\Scanner', 'scanFolder', function ($path) use ($mount, $emitter) { |
|
125 | - $emitter->emit('\OC\Files\Utils\Scanner', 'scanFolder', array($mount->getMountPoint() . $path)); |
|
124 | + $scanner->listen('\OC\Files\Cache\Scanner', 'scanFolder', function($path) use ($mount, $emitter) { |
|
125 | + $emitter->emit('\OC\Files\Utils\Scanner', 'scanFolder', array($mount->getMountPoint().$path)); |
|
126 | 126 | }); |
127 | - $scanner->listen('\OC\Files\Cache\Scanner', 'postScanFile', function ($path) use ($mount, $emitter) { |
|
128 | - $emitter->emit('\OC\Files\Utils\Scanner', 'postScanFile', array($mount->getMountPoint() . $path)); |
|
127 | + $scanner->listen('\OC\Files\Cache\Scanner', 'postScanFile', function($path) use ($mount, $emitter) { |
|
128 | + $emitter->emit('\OC\Files\Utils\Scanner', 'postScanFile', array($mount->getMountPoint().$path)); |
|
129 | 129 | }); |
130 | - $scanner->listen('\OC\Files\Cache\Scanner', 'postScanFolder', function ($path) use ($mount, $emitter) { |
|
131 | - $emitter->emit('\OC\Files\Utils\Scanner', 'postScanFolder', array($mount->getMountPoint() . $path)); |
|
130 | + $scanner->listen('\OC\Files\Cache\Scanner', 'postScanFolder', function($path) use ($mount, $emitter) { |
|
131 | + $emitter->emit('\OC\Files\Utils\Scanner', 'postScanFolder', array($mount->getMountPoint().$path)); |
|
132 | 132 | }); |
133 | 133 | } |
134 | 134 | |
@@ -160,13 +160,13 @@ discard block |
||
160 | 160 | $scanner = $storage->getScanner(); |
161 | 161 | $this->attachListener($mount); |
162 | 162 | |
163 | - $scanner->listen('\OC\Files\Cache\Scanner', 'removeFromCache', function ($path) use ($storage) { |
|
163 | + $scanner->listen('\OC\Files\Cache\Scanner', 'removeFromCache', function($path) use ($storage) { |
|
164 | 164 | $this->triggerPropagator($storage, $path); |
165 | 165 | }); |
166 | - $scanner->listen('\OC\Files\Cache\Scanner', 'updateCache', function ($path) use ($storage) { |
|
166 | + $scanner->listen('\OC\Files\Cache\Scanner', 'updateCache', function($path) use ($storage) { |
|
167 | 167 | $this->triggerPropagator($storage, $path); |
168 | 168 | }); |
169 | - $scanner->listen('\OC\Files\Cache\Scanner', 'addToCache', function ($path) use ($storage) { |
|
169 | + $scanner->listen('\OC\Files\Cache\Scanner', 'addToCache', function($path) use ($storage) { |
|
170 | 170 | $this->triggerPropagator($storage, $path); |
171 | 171 | }); |
172 | 172 | |
@@ -219,13 +219,13 @@ discard block |
||
219 | 219 | $scanner->setUseTransactions(false); |
220 | 220 | $this->attachListener($mount); |
221 | 221 | |
222 | - $scanner->listen('\OC\Files\Cache\Scanner', 'removeFromCache', function ($path) use ($storage) { |
|
222 | + $scanner->listen('\OC\Files\Cache\Scanner', 'removeFromCache', function($path) use ($storage) { |
|
223 | 223 | $this->postProcessEntry($storage, $path); |
224 | 224 | }); |
225 | - $scanner->listen('\OC\Files\Cache\Scanner', 'updateCache', function ($path) use ($storage) { |
|
225 | + $scanner->listen('\OC\Files\Cache\Scanner', 'updateCache', function($path) use ($storage) { |
|
226 | 226 | $this->postProcessEntry($storage, $path); |
227 | 227 | }); |
228 | - $scanner->listen('\OC\Files\Cache\Scanner', 'addToCache', function ($path) use ($storage) { |
|
228 | + $scanner->listen('\OC\Files\Cache\Scanner', 'addToCache', function($path) use ($storage) { |
|
229 | 229 | $this->postProcessEntry($storage, $path); |
230 | 230 | }); |
231 | 231 | |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | } |
248 | 248 | $propagator->commitBatch(); |
249 | 249 | } catch (StorageNotAvailableException $e) { |
250 | - $this->logger->error('Storage ' . $storage->getId() . ' not available'); |
|
250 | + $this->logger->error('Storage '.$storage->getId().' not available'); |
|
251 | 251 | $this->logger->logException($e); |
252 | 252 | $this->emit('\OC\Files\Utils\Scanner', 'StorageNotAvailable', [$e]); |
253 | 253 | } |