@@ -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()) { |
@@ -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 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @param callable $callback |
| 36 | 36 | */ |
| 37 | 37 | public function listen($scope, $method, callable $callback) { |
| 38 | - $eventName = $scope . '::' . $method; |
|
| 38 | + $eventName = $scope.'::'.$method; |
|
| 39 | 39 | if (!isset($this->listeners[$eventName])) { |
| 40 | 40 | $this->listeners[$eventName] = []; |
| 41 | 41 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $names = []; |
| 54 | 54 | $allNames = array_keys($this->listeners); |
| 55 | 55 | if ($scope and $method) { |
| 56 | - $name = $scope . '::' . $method; |
|
| 56 | + $name = $scope.'::'.$method; |
|
| 57 | 57 | if (isset($this->listeners[$name])) { |
| 58 | 58 | $names[] = $name; |
| 59 | 59 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | * @param array $arguments optional |
| 94 | 94 | */ |
| 95 | 95 | protected function emit($scope, $method, array $arguments = []) { |
| 96 | - $eventName = $scope . '::' . $method; |
|
| 96 | + $eventName = $scope.'::'.$method; |
|
| 97 | 97 | if (isset($this->listeners[$eventName])) { |
| 98 | 98 | foreach ($this->listeners[$eventName] as $callback) { |
| 99 | 99 | call_user_func_array($callback, $arguments); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | $this->doFind($resource); |
| 76 | 76 | } catch (ResourceNotFoundException $e) { |
| 77 | 77 | $resourceApp = substr($resource, 0, strpos($resource, '/')); |
| 78 | - $this->logger->debug('Could not find resource file "' . $e->getResourcePath() . '"', ['app' => $resourceApp]); |
|
| 78 | + $this->logger->debug('Could not find resource file "'.$e->getResourcePath().'"', ['app' => $resourceApp]); |
|
| 79 | 79 | } |
| 80 | 80 | } |
| 81 | 81 | if (!empty($this->theme)) { |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $this->doFindTheme($resource); |
| 85 | 85 | } catch (ResourceNotFoundException $e) { |
| 86 | 86 | $resourceApp = substr($resource, 0, strpos($resource, '/')); |
| 87 | - $this->logger->debug('Could not find resource file in theme "' . $e->getResourcePath() . '"', ['app' => $resourceApp]); |
|
| 87 | + $this->logger->debug('Could not find resource file in theme "'.$e->getResourcePath().'"', ['app' => $resourceApp]); |
|
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | } |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | } |
| 159 | 159 | $this->resources[] = [$root, $webRoot, $file]; |
| 160 | 160 | |
| 161 | - if ($throw && !is_file($root . '/' . $file)) { |
|
| 161 | + if ($throw && !is_file($root.'/'.$file)) { |
|
| 162 | 162 | throw new ResourceNotFoundException($file, $webRoot); |
| 163 | 163 | } |
| 164 | 164 | } |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | // always add owner to the list of users with access to the file |
| 74 | 74 | $userIds = [$owner]; |
| 75 | 75 | |
| 76 | - if (!$this->util->isFile($owner . '/' . $ownerPath)) { |
|
| 76 | + if (!$this->util->isFile($owner.'/'.$ownerPath)) { |
|
| 77 | 77 | return ['users' => $userIds, 'public' => false]; |
| 78 | 78 | } |
| 79 | 79 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $linkCheckPlugin = new \OCA\DAV\Files\Sharing\PublicLinkCheckPlugin(); |
| 61 | 61 | $filesDropPlugin = new \OCA\DAV\Files\Sharing\FilesDropPlugin(); |
| 62 | 62 | |
| 63 | -$server = $serverFactory->createServer($baseuri, $requestUri, $authPlugin, function (\Sabre\DAV\Server $server) use ($authBackend, $linkCheckPlugin, $filesDropPlugin) { |
|
| 63 | +$server = $serverFactory->createServer($baseuri, $requestUri, $authPlugin, function(\Sabre\DAV\Server $server) use ($authBackend, $linkCheckPlugin, $filesDropPlugin) { |
|
| 64 | 64 | $isAjax = (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] === 'XMLHttpRequest'); |
| 65 | 65 | $federatedSharingApp = new \OCA\FederatedFileSharing\AppInfo\Application(); |
| 66 | 66 | $federatedShareProvider = $federatedSharingApp->getFederatedShareProvider(); |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | // FIXME: should not add storage wrappers outside of preSetup, need to find a better way |
| 78 | 78 | $previousLog = \OC\Files\Filesystem::logWarningWhenAddingStorageWrapper(false); |
| 79 | - \OC\Files\Filesystem::addStorageWrapper('sharePermissions', function ($mountPoint, $storage) use ($share) { |
|
| 79 | + \OC\Files\Filesystem::addStorageWrapper('sharePermissions', function($mountPoint, $storage) use ($share) { |
|
| 80 | 80 | return new \OC\Files\Storage\Wrapper\PermissionsMask(['storage' => $storage, 'mask' => $share->getPermissions() | \OCP\Constants::PERMISSION_SHARE]); |
| 81 | 81 | }); |
| 82 | 82 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | OC_Util::tearDownFS(); |
| 86 | 86 | OC_Util::setupFS($owner); |
| 87 | - $ownerView = new \OC\Files\View('/'. $owner . '/files'); |
|
| 87 | + $ownerView = new \OC\Files\View('/'.$owner.'/files'); |
|
| 88 | 88 | $path = $ownerView->getPath($fileId); |
| 89 | 89 | $fileInfo = $ownerView->getFileInfo($path); |
| 90 | 90 | $linkCheckPlugin->setFileInfo($fileInfo); |
@@ -197,7 +197,7 @@ |
||
| 197 | 197 | } catch (NotFoundException $e) { |
| 198 | 198 | return new DataResponse( |
| 199 | 199 | [ |
| 200 | - 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id]) |
|
| 200 | + 'message' => (string) $this->l10n->t('Storage with ID "%d" not found', [$id]) |
|
| 201 | 201 | ], |
| 202 | 202 | Http::STATUS_NOT_FOUND |
| 203 | 203 | ); |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | } catch (NotFoundException $e) { |
| 123 | 123 | return new DataResponse( |
| 124 | 124 | [ |
| 125 | - 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id]) |
|
| 125 | + 'message' => (string) $this->l10n->t('Storage with ID "%d" not found', [$id]) |
|
| 126 | 126 | ], |
| 127 | 127 | Http::STATUS_NOT_FOUND |
| 128 | 128 | ); |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | } else { |
| 163 | 163 | return new DataResponse( |
| 164 | 164 | [ |
| 165 | - 'message' => (string)$this->l10n->t('Storage with ID "%d" is not user editable', [$id]) |
|
| 165 | + 'message' => (string) $this->l10n->t('Storage with ID "%d" is not user editable', [$id]) |
|
| 166 | 166 | ], |
| 167 | 167 | Http::STATUS_FORBIDDEN |
| 168 | 168 | ); |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | } catch (NotFoundException $e) { |
| 171 | 171 | return new DataResponse( |
| 172 | 172 | [ |
| 173 | - 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id]) |
|
| 173 | + 'message' => (string) $this->l10n->t('Storage with ID "%d" not found', [$id]) |
|
| 174 | 174 | ], |
| 175 | 175 | Http::STATUS_NOT_FOUND |
| 176 | 176 | ); |
@@ -197,7 +197,7 @@ |
||
| 197 | 197 | } catch (NotFoundException $e) { |
| 198 | 198 | return new DataResponse( |
| 199 | 199 | [ |
| 200 | - 'message' => (string)$this->l10n->t('Storage with ID "%d" not found', [$id]) |
|
| 200 | + 'message' => (string) $this->l10n->t('Storage with ID "%d" not found', [$id]) |
|
| 201 | 201 | ], |
| 202 | 202 | Http::STATUS_NOT_FOUND |
| 203 | 203 | ); |