@@ -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 | |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | /** @var Folder $folder $results */ |
| 156 | 156 | $results = $folder->search($query); |
| 157 | 157 | |
| 158 | - return array_map(function (Node $node) { |
|
| 158 | + return array_map(function(Node $node) { |
|
| 159 | 159 | if ($node instanceof Folder) { |
| 160 | 160 | return new SearchResult(new \OCA\DAV\Connector\Sabre\Directory($this->view, $node, $this->tree, $this->shareManager), $this->getHrefForNode($node)); |
| 161 | 161 | } else { |
@@ -169,8 +169,8 @@ discard block |
||
| 169 | 169 | * @return string |
| 170 | 170 | */ |
| 171 | 171 | private function getHrefForNode(Node $node) { |
| 172 | - $base = '/files/' . $this->user->getUID(); |
|
| 173 | - return $base . $this->view->getRelativePath($node->getPath()); |
|
| 172 | + $base = '/files/'.$this->user->getUID(); |
|
| 173 | + return $base.$this->view->getRelativePath($node->getPath()); |
|
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | /** |
@@ -210,19 +210,19 @@ discard block |
||
| 210 | 210 | case Operator::OPERATION_LESS_THAN: |
| 211 | 211 | case Operator::OPERATION_IS_LIKE: |
| 212 | 212 | if (count($operator->arguments) !== 2) { |
| 213 | - throw new \InvalidArgumentException('Invalid number of arguments for ' . $trimmedType . ' operation'); |
|
| 213 | + throw new \InvalidArgumentException('Invalid number of arguments for '.$trimmedType.' operation'); |
|
| 214 | 214 | } |
| 215 | 215 | if (!is_string($operator->arguments[0])) { |
| 216 | - throw new \InvalidArgumentException('Invalid argument 1 for ' . $trimmedType . ' operation, expected property'); |
|
| 216 | + throw new \InvalidArgumentException('Invalid argument 1 for '.$trimmedType.' operation, expected property'); |
|
| 217 | 217 | } |
| 218 | 218 | if (!($operator->arguments[1] instanceof Literal)) { |
| 219 | - throw new \InvalidArgumentException('Invalid argument 2 for ' . $trimmedType . ' operation, expected literal'); |
|
| 219 | + throw new \InvalidArgumentException('Invalid argument 2 for '.$trimmedType.' operation, expected literal'); |
|
| 220 | 220 | } |
| 221 | 221 | return new SearchComparison($trimmedType, $this->mapPropertyNameToColumn($operator->arguments[0]), $this->castValue($operator->arguments[0], $operator->arguments[1]->value)); |
| 222 | 222 | case Operator::OPERATION_IS_COLLECTION: |
| 223 | 223 | return new SearchComparison('eq', 'mimetype', ICacheEntry::DIRECTORY_MIMETYPE); |
| 224 | 224 | default: |
| 225 | - throw new \InvalidArgumentException('Unsupported operation ' . $trimmedType. ' (' . $operator->type . ')'); |
|
| 225 | + throw new \InvalidArgumentException('Unsupported operation '.$trimmedType.' ('.$operator->type.')'); |
|
| 226 | 226 | } |
| 227 | 227 | } |
| 228 | 228 | |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | case TagsPlugin::TAGS_PROPERTYNAME: |
| 246 | 246 | return 'tagname'; |
| 247 | 247 | default: |
| 248 | - throw new \InvalidArgumentException('Unsupported property for search or order: ' . $propertyName); |
|
| 248 | + throw new \InvalidArgumentException('Unsupported property for search or order: '.$propertyName); |
|
| 249 | 249 | } |
| 250 | 250 | } |
| 251 | 251 | |