@@ -274,7 +274,7 @@ |
||
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | // check if key storage is mounted correctly |
| 277 | - if ($this->rootView->file_exists($rootDir . '/' . Storage::KEY_STORAGE_MARKER)) { |
|
| 277 | + if ($this->rootView->file_exists($rootDir.'/'.Storage::KEY_STORAGE_MARKER)) { |
|
| 278 | 278 | return true; |
| 279 | 279 | } |
| 280 | 280 | |
@@ -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,8 +65,8 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | $output->startProgress(count($objects)); |
| 67 | 67 | foreach ($objects as $row) { |
| 68 | - $calObject = $this->calDavBackend->getCalendarObject((int)$row['calendarid'], $row['uri']); |
|
| 69 | - $data = preg_replace('/' . $pattern . '/', ':', $calObject['calendardata']); |
|
| 68 | + $calObject = $this->calDavBackend->getCalendarObject((int) $row['calendarid'], $row['uri']); |
|
| 69 | + $data = preg_replace('/'.$pattern.'/', ':', $calObject['calendardata']); |
|
| 70 | 70 | |
| 71 | 71 | if ($data !== $calObject['calendardata']) { |
| 72 | 72 | $output->advance(); |
@@ -76,14 +76,14 @@ discard block |
||
| 76 | 76 | } catch (InvalidDataException $e) { |
| 77 | 77 | $this->logger->info('Calendar object for calendar {cal} with uri {uri} still invalid', [ |
| 78 | 78 | 'app' => 'dav', |
| 79 | - 'cal' => (int)$row['calendarid'], |
|
| 79 | + 'cal' => (int) $row['calendarid'], |
|
| 80 | 80 | 'uri' => $row['uri'], |
| 81 | 81 | ]); |
| 82 | 82 | $warnings++; |
| 83 | 83 | continue; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | - $this->calDavBackend->updateCalendarObject((int)$row['calendarid'], $row['uri'], $data); |
|
| 86 | + $this->calDavBackend->updateCalendarObject((int) $row['calendarid'], $row['uri'], $data); |
|
| 87 | 87 | $count++; |
| 88 | 88 | } |
| 89 | 89 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | ->where($query->expr()->like( |
| 105 | 105 | 'calendardata', |
| 106 | 106 | $query->createNamedParameter( |
| 107 | - '%' . $this->db->escapeLikeParameter($pattern) . '%', |
|
| 107 | + '%'.$this->db->escapeLikeParameter($pattern).'%', |
|
| 108 | 108 | IQueryBuilder::PARAM_STR |
| 109 | 109 | ), |
| 110 | 110 | IQueryBuilder::PARAM_STR |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | $reader->parseInnerTree(); |
| 40 | 40 | |
| 41 | 41 | if (!is_string($componentName)) { |
| 42 | - throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}comp-filter requires a valid name attribute'); |
|
| 42 | + throw new BadRequest('The {'.SearchPlugin::NS_Nextcloud.'}comp-filter requires a valid name attribute'); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | return $componentName; |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | $reader->parseInnerTree(); |
| 40 | 40 | |
| 41 | 41 | if (!is_string($componentName)) { |
| 42 | - throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}prop-filter requires a valid name attribute'); |
|
| 42 | + throw new BadRequest('The {'.SearchPlugin::NS_Nextcloud.'}prop-filter requires a valid name attribute'); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | return $componentName; |
@@ -40,11 +40,11 @@ |
||
| 40 | 40 | $reader->parseInnerTree(); |
| 41 | 41 | |
| 42 | 42 | if (!is_string($property)) { |
| 43 | - throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}param-filter requires a valid property attribute'); |
|
| 43 | + throw new BadRequest('The {'.SearchPlugin::NS_Nextcloud.'}param-filter requires a valid property attribute'); |
|
| 44 | 44 | |
| 45 | 45 | } |
| 46 | 46 | if (!is_string($parameter)) { |
| 47 | - throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}param-filter requires a valid parameter attribute'); |
|
| 47 | + throw new BadRequest('The {'.SearchPlugin::NS_Nextcloud.'}param-filter requires a valid parameter attribute'); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | return [ |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | $item = $node; |
| 117 | - $appendix = '/' . $node->getName(); |
|
| 117 | + $appendix = '/'.$node->getName(); |
|
| 118 | 118 | while (!empty($byId)) { |
| 119 | 119 | try { |
| 120 | 120 | /** @var Node $item */ |
@@ -122,12 +122,12 @@ discard block |
||
| 122 | 122 | |
| 123 | 123 | if (!empty($byId[$item->getId()])) { |
| 124 | 124 | foreach ($byId[$item->getId()] as $uid => $path) { |
| 125 | - $results[$uid] = $path . $appendix; |
|
| 125 | + $results[$uid] = $path.$appendix; |
|
| 126 | 126 | } |
| 127 | 127 | unset($byId[$item->getId()]); |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - $appendix = '/' . $item->getName() . $appendix; |
|
| 130 | + $appendix = '/'.$item->getName().$appendix; |
|
| 131 | 131 | } catch (NotFoundException $e) { |
| 132 | 132 | return $results; |
| 133 | 133 | } catch (InvalidPathException $e) { |
@@ -212,6 +212,6 @@ discard block |
||
| 212 | 212 | protected function getMountedPath(Node $node) { |
| 213 | 213 | $path = $node->getPath(); |
| 214 | 214 | $sections = explode('/', $path, 4); |
| 215 | - return '/' . $sections[3]; |
|
| 215 | + return '/'.$sections[3]; |
|
| 216 | 216 | } |
| 217 | 217 | } |
@@ -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 | |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | * @return bool |
| 33 | 33 | */ |
| 34 | 34 | private function isValidVersionString($versionString) { |
| 35 | - return (bool)preg_match('/^[0-9.]+$/', $versionString); |
|
| 35 | + return (bool) preg_match('/^[0-9.]+$/', $versionString); |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |