@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | $principals = []; |
| 60 | 60 | |
| 61 | 61 | if ($prefixPath === self::PRINCIPAL_PREFIX) { |
| 62 | - foreach($this->groupManager->search('') as $user) { |
|
| 62 | + foreach ($this->groupManager->search('') as $user) { |
|
| 63 | 63 | $principals[] = $this->groupToPrincipal($user); |
| 64 | 64 | } |
| 65 | 65 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | * @return array |
| 77 | 77 | */ |
| 78 | 78 | public function getPrincipalByPath($path) { |
| 79 | - $elements = explode('/', $path, 3); |
|
| 79 | + $elements = explode('/', $path, 3); |
|
| 80 | 80 | if ($elements[0] !== 'principals') { |
| 81 | 81 | return null; |
| 82 | 82 | } |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | protected function groupToPrincipal($group) { |
| 180 | 180 | $groupId = $group->getGID(); |
| 181 | 181 | $principal = [ |
| 182 | - 'uri' => 'principals/groups/' . urlencode($groupId), |
|
| 182 | + 'uri' => 'principals/groups/'.urlencode($groupId), |
|
| 183 | 183 | '{DAV:}displayname' => $groupId, |
| 184 | 184 | ]; |
| 185 | 185 | |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | */ |
| 193 | 193 | protected function userToPrincipal($user) { |
| 194 | 194 | $principal = [ |
| 195 | - 'uri' => 'principals/users/' . $user->getUID(), |
|
| 195 | + 'uri' => 'principals/users/'.$user->getUID(), |
|
| 196 | 196 | '{DAV:}displayname' => $user->getDisplayName(), |
| 197 | 197 | ]; |
| 198 | 198 | |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | <div class="warning"> |
| 15 | 15 | <h2 class="two-factor-header"><?php p($provider->getDisplayName()); ?></h2> |
| 16 | 16 | <?php if ($error): ?> |
| 17 | - <?php if($error_message): ?> |
|
| 17 | + <?php if ($error_message): ?> |
|
| 18 | 18 | <p><strong><?php p($error_message); ?></strong></p> |
| 19 | 19 | <?php else: ?> |
| 20 | 20 | <p><strong><?php p($l->t('Error while validating your second factor')); ?></strong></p> |
@@ -88,7 +88,7 @@ |
||
| 88 | 88 | if (strpos($path, '/webdav/') === 0) { |
| 89 | 89 | $path = substr($path, strlen('/webdav')); |
| 90 | 90 | } |
| 91 | - $path = $this->path . $path; |
|
| 91 | + $path = $this->path.$path; |
|
| 92 | 92 | $this->mimeType[$this->storage->getId()][$path] = $this->mimeTypeDetector->detectPath($path); |
| 93 | 93 | return $this->mimeType[$this->storage->getId()][$path]; |
| 94 | 94 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | public function shouldJoinTags(ISearchOperator $operator) { |
| 73 | 73 | if ($operator instanceof ISearchBinaryOperator) { |
| 74 | - return array_reduce($operator->getArguments(), function ($shouldJoin, ISearchOperator $operator) { |
|
| 74 | + return array_reduce($operator->getArguments(), function($shouldJoin, ISearchOperator $operator) { |
|
| 75 | 75 | return $shouldJoin || $this->shouldJoinTags($operator); |
| 76 | 76 | }, false); |
| 77 | 77 | } else if ($operator instanceof ISearchComparison) { |
@@ -96,12 +96,12 @@ discard block |
||
| 96 | 96 | case ISearchBinaryOperator::OPERATOR_OR: |
| 97 | 97 | return $expr->orX($this->searchOperatorToDBExpr($builder, $operator->getArguments()[0]), $this->searchOperatorToDBExpr($builder, $operator->getArguments()[1])); |
| 98 | 98 | default: |
| 99 | - throw new \InvalidArgumentException('Invalid operator type: ' . $operator->getType()); |
|
| 99 | + throw new \InvalidArgumentException('Invalid operator type: '.$operator->getType()); |
|
| 100 | 100 | } |
| 101 | 101 | } else if ($operator instanceof ISearchComparison) { |
| 102 | 102 | return $this->searchComparisonToDBExpr($builder, $operator, self::$searchOperatorMap); |
| 103 | 103 | } else { |
| 104 | - throw new \InvalidArgumentException('Invalid operator type: ' . get_class($operator)); |
|
| 104 | + throw new \InvalidArgumentException('Invalid operator type: '.get_class($operator)); |
|
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | 107 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $queryOperator = $operatorMap[$type]; |
| 114 | 114 | return $builder->expr()->$queryOperator($field, $this->getParameterForValue($builder, $value)); |
| 115 | 115 | } else { |
| 116 | - throw new \InvalidArgumentException('Invalid operator type: ' . $comparison->getType()); |
|
| 116 | + throw new \InvalidArgumentException('Invalid operator type: '.$comparison->getType()); |
|
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | 119 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | $type = ISearchComparison::COMPARE_EQUAL; |
| 133 | 133 | } |
| 134 | 134 | if (strpos($value, '%') !== false) { |
| 135 | - throw new \InvalidArgumentException('Unsupported query value for mimetype: ' . $value . ', only values in the format "mime/type" or "mime/%" are supported'); |
|
| 135 | + throw new \InvalidArgumentException('Unsupported query value for mimetype: '.$value.', only values in the format "mime/type" or "mime/%" are supported'); |
|
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | 138 | } else if ($field === 'favorite') { |
@@ -163,14 +163,14 @@ discard block |
||
| 163 | 163 | ]; |
| 164 | 164 | |
| 165 | 165 | if (!isset($types[$operator->getField()])) { |
| 166 | - throw new \InvalidArgumentException('Unsupported comparison field ' . $operator->getField()); |
|
| 166 | + throw new \InvalidArgumentException('Unsupported comparison field '.$operator->getField()); |
|
| 167 | 167 | } |
| 168 | 168 | $type = $types[$operator->getField()]; |
| 169 | 169 | if (gettype($operator->getValue()) !== $type) { |
| 170 | - throw new \InvalidArgumentException('Invalid type for field ' . $operator->getField()); |
|
| 170 | + throw new \InvalidArgumentException('Invalid type for field '.$operator->getField()); |
|
| 171 | 171 | } |
| 172 | 172 | if (!in_array($operator->getType(), $comparisons[$operator->getField()])) { |
| 173 | - throw new \InvalidArgumentException('Unsupported comparison for field ' . $operator->getField() . ': ' . $operator->getType()); |
|
| 173 | + throw new \InvalidArgumentException('Unsupported comparison for field '.$operator->getField().': '.$operator->getType()); |
|
| 174 | 174 | } |
| 175 | 175 | } |
| 176 | 176 | |
@@ -46,11 +46,11 @@ |
||
| 46 | 46 | $tags = $getID3->analyze($tmpPath); |
| 47 | 47 | unlink($tmpPath); |
| 48 | 48 | $picture = isset($tags['id3v2']['APIC'][0]['data']) ? $tags['id3v2']['APIC'][0]['data'] : null; |
| 49 | - if(is_null($picture) && isset($tags['id3v2']['PIC'][0]['data'])) { |
|
| 49 | + if (is_null($picture) && isset($tags['id3v2']['PIC'][0]['data'])) { |
|
| 50 | 50 | $picture = $tags['id3v2']['PIC'][0]['data']; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - if(!is_null($picture)) { |
|
| 53 | + if (!is_null($picture)) { |
|
| 54 | 54 | $image = new \OC_Image(); |
| 55 | 55 | $image->loadFromData($picture); |
| 56 | 56 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | 'remoteId' => $shareId |
| 135 | 135 | ); |
| 136 | 136 | |
| 137 | - $result = $this->tryHttpPostToShareEndpoint(rtrim($remote, '/'), '/' . $id . '/reshare', $fields); |
|
| 137 | + $result = $this->tryHttpPostToShareEndpoint(rtrim($remote, '/'), '/'.$id.'/reshare', $fields); |
|
| 138 | 138 | $status = json_decode($result['result'], true); |
| 139 | 139 | |
| 140 | 140 | $httpRequestSuccessful = $result['success']; |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | if ($httpRequestSuccessful && $ocsCallSuccessful && $validToken && $validRemoteId) { |
| 146 | 146 | return [ |
| 147 | 147 | $status['ocs']['data']['token'], |
| 148 | - (int)$status['ocs']['data']['remoteId'] |
|
| 148 | + (int) $status['ocs']['data']['remoteId'] |
|
| 149 | 149 | ]; |
| 150 | 150 | } |
| 151 | 151 | |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | $fields[$key] = $value; |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | - $result = $this->tryHttpPostToShareEndpoint(rtrim($remote, '/'), '/' . $remoteId . '/' . $action, $fields); |
|
| 232 | + $result = $this->tryHttpPostToShareEndpoint(rtrim($remote, '/'), '/'.$remoteId.'/'.$action, $fields); |
|
| 233 | 233 | $status = json_decode($result['result'], true); |
| 234 | 234 | |
| 235 | 235 | if ($result['success'] && |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | $client = $this->httpClientService->newClient(); |
| 281 | 281 | |
| 282 | 282 | if ($this->addressHandler->urlContainProtocol($remoteDomain) === false) { |
| 283 | - $remoteDomain = 'https://' . $remoteDomain; |
|
| 283 | + $remoteDomain = 'https://'.$remoteDomain; |
|
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | $result = [ |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | $federationEndpoints = $this->discoveryService->discover($remoteDomain, 'FEDERATED_SHARING'); |
| 292 | 292 | $endpoint = isset($federationEndpoints['share']) ? $federationEndpoints['share'] : '/ocs/v2.php/cloud/shares'; |
| 293 | 293 | try { |
| 294 | - $response = $client->post($remoteDomain . $endpoint . $urlSuffix . '?format=' . self::RESPONSE_FORMAT, [ |
|
| 294 | + $response = $client->post($remoteDomain.$endpoint.$urlSuffix.'?format='.self::RESPONSE_FORMAT, [ |
|
| 295 | 295 | 'body' => $fields, |
| 296 | 296 | 'timeout' => 10, |
| 297 | 297 | 'connect_timeout' => 10, |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | $secure = $protocol === 'https'; |
| 78 | 78 | $federatedSharingEndpoints = $discoveryService->discover($this->cloudId->getRemote(), 'FEDERATED_SHARING'); |
| 79 | 79 | $webDavEndpoint = isset($federatedSharingEndpoints['webdav']) ? $federatedSharingEndpoints['webdav'] : '/public.php/webdav'; |
| 80 | - $root = rtrim($root, '/') . $webDavEndpoint; |
|
| 80 | + $root = rtrim($root, '/').$webDavEndpoint; |
|
| 81 | 81 | $this->mountPoint = $options['mountpoint']; |
| 82 | 82 | $this->token = $options['token']; |
| 83 | 83 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | 'host' => $host, |
| 87 | 87 | 'root' => $root, |
| 88 | 88 | 'user' => $options['token'], |
| 89 | - 'password' => (string)$options['password'] |
|
| 89 | + 'password' => (string) $options['password'] |
|
| 90 | 90 | )); |
| 91 | 91 | } |
| 92 | 92 | |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | * @return string |
| 127 | 127 | */ |
| 128 | 128 | public function getId() { |
| 129 | - return 'shared::' . md5($this->token . '@' . $this->getRemote()); |
|
| 129 | + return 'shared::'.md5($this->token.'@'.$this->getRemote()); |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | public function getCache($path = '', $storage = null) { |
@@ -247,9 +247,9 @@ discard block |
||
| 247 | 247 | */ |
| 248 | 248 | protected function testRemote() { |
| 249 | 249 | try { |
| 250 | - return $this->testRemoteUrl($this->getRemote() . '/ocs-provider/index.php') |
|
| 251 | - || $this->testRemoteUrl($this->getRemote() . '/ocs-provider/') |
|
| 252 | - || $this->testRemoteUrl($this->getRemote() . '/status.php'); |
|
| 250 | + return $this->testRemoteUrl($this->getRemote().'/ocs-provider/index.php') |
|
| 251 | + || $this->testRemoteUrl($this->getRemote().'/ocs-provider/') |
|
| 252 | + || $this->testRemoteUrl($this->getRemote().'/status.php'); |
|
| 253 | 253 | } catch (\Exception $e) { |
| 254 | 254 | return false; |
| 255 | 255 | } |
@@ -261,8 +261,8 @@ discard block |
||
| 261 | 261 | */ |
| 262 | 262 | private function testRemoteUrl($url) { |
| 263 | 263 | $cache = $this->memcacheFactory->create('files_sharing_remote_url'); |
| 264 | - if($cache->hasKey($url)) { |
|
| 265 | - return (bool)$cache->get($url); |
|
| 264 | + if ($cache->hasKey($url)) { |
|
| 265 | + return (bool) $cache->get($url); |
|
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | $client = $this->httpClient->newClient(); |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | * @return bool |
| 291 | 291 | */ |
| 292 | 292 | public function remoteIsOwnCloud() { |
| 293 | - if(defined('PHPUNIT_RUN') || !$this->testRemoteUrl($this->getRemote() . '/status.php')) { |
|
| 293 | + if (defined('PHPUNIT_RUN') || !$this->testRemoteUrl($this->getRemote().'/status.php')) { |
|
| 294 | 294 | return false; |
| 295 | 295 | } |
| 296 | 296 | return true; |
@@ -308,11 +308,11 @@ discard block |
||
| 308 | 308 | $password = $this->getPassword(); |
| 309 | 309 | |
| 310 | 310 | // If remote is not an ownCloud do not try to get any share info |
| 311 | - if(!$this->remoteIsOwnCloud()) { |
|
| 311 | + if (!$this->remoteIsOwnCloud()) { |
|
| 312 | 312 | return ['status' => 'unsupported']; |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | - $url = rtrim($remote, '/') . '/index.php/apps/files_sharing/shareinfo?t=' . $token; |
|
| 315 | + $url = rtrim($remote, '/').'/index.php/apps/files_sharing/shareinfo?t='.$token; |
|
| 316 | 316 | |
| 317 | 317 | // TODO: DI |
| 318 | 318 | $client = \OC::$server->getHTTPClientService()->newClient(); |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | if ($provider === null) { |
| 217 | - throw new ProviderException('No provider with id .' . $id . ' found.'); |
|
| 217 | + throw new ProviderException('No provider with id .'.$id.' found.'); |
|
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | return $provider; |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | |
| 242 | 242 | |
| 243 | 243 | if ($provider === null) { |
| 244 | - throw new ProviderException('No share provider for share type ' . $shareType); |
|
| 244 | + throw new ProviderException('No share provider for share type '.$shareType); |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | return $provider; |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | $eventDispatcher->addListener(MapperEvent::EVENT_ASSIGN, $mapperListener); |
| 66 | 66 | $eventDispatcher->addListener(MapperEvent::EVENT_UNASSIGN, $mapperListener); |
| 67 | 67 | |
| 68 | -\OCA\Files\App::getNavigationManager()->add(function () { |
|
| 68 | +\OCA\Files\App::getNavigationManager()->add(function() { |
|
| 69 | 69 | $l = \OC::$server->getL10N('systemtags'); |
| 70 | 70 | return [ |
| 71 | 71 | 'id' => 'systemtagsfilter', |