@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function shouldJoinTags(ISearchOperator $operator) { |
76 | 76 | if ($operator instanceof ISearchBinaryOperator) { |
77 | - return array_reduce($operator->getArguments(), function ($shouldJoin, ISearchOperator $operator) { |
|
77 | + return array_reduce($operator->getArguments(), function($shouldJoin, ISearchOperator $operator) { |
|
78 | 78 | return $shouldJoin || $this->shouldJoinTags($operator); |
79 | 79 | }, false); |
80 | 80 | } else if ($operator instanceof ISearchComparison) { |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | * @param ISearchOperator $operator |
89 | 89 | */ |
90 | 90 | public function searchOperatorArrayToDBExprArray(IQueryBuilder $builder, array $operators) { |
91 | - return array_map(function ($operator) use ($builder) { |
|
91 | + return array_map(function($operator) use ($builder) { |
|
92 | 92 | return $this->searchOperatorToDBExpr($builder, $operator); |
93 | 93 | }, $operators); |
94 | 94 | } |
@@ -109,12 +109,12 @@ discard block |
||
109 | 109 | case ISearchBinaryOperator::OPERATOR_OR: |
110 | 110 | return call_user_func_array([$expr, 'orX'], $this->searchOperatorArrayToDBExprArray($builder, $operator->getArguments())); |
111 | 111 | default: |
112 | - throw new \InvalidArgumentException('Invalid operator type: ' . $operator->getType()); |
|
112 | + throw new \InvalidArgumentException('Invalid operator type: '.$operator->getType()); |
|
113 | 113 | } |
114 | 114 | } else if ($operator instanceof ISearchComparison) { |
115 | 115 | return $this->searchComparisonToDBExpr($builder, $operator, self::$searchOperatorMap); |
116 | 116 | } else { |
117 | - throw new \InvalidArgumentException('Invalid operator type: ' . get_class($operator)); |
|
117 | + throw new \InvalidArgumentException('Invalid operator type: '.get_class($operator)); |
|
118 | 118 | } |
119 | 119 | } |
120 | 120 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | $queryOperator = $operatorMap[$type]; |
127 | 127 | return $builder->expr()->$queryOperator($field, $this->getParameterForValue($builder, $value)); |
128 | 128 | } else { |
129 | - throw new \InvalidArgumentException('Invalid operator type: ' . $comparison->getType()); |
|
129 | + throw new \InvalidArgumentException('Invalid operator type: '.$comparison->getType()); |
|
130 | 130 | } |
131 | 131 | } |
132 | 132 | |
@@ -136,18 +136,18 @@ discard block |
||
136 | 136 | $type = $operator->getType(); |
137 | 137 | if ($field === 'mimetype') { |
138 | 138 | if ($operator->getType() === ISearchComparison::COMPARE_EQUAL) { |
139 | - $value = (int)$this->mimetypeLoader->getId($value); |
|
139 | + $value = (int) $this->mimetypeLoader->getId($value); |
|
140 | 140 | } else if ($operator->getType() === ISearchComparison::COMPARE_LIKE) { |
141 | 141 | // transform "mimetype='foo/%'" to "mimepart='foo'" |
142 | 142 | if (preg_match('|(.+)/%|', $value, $matches)) { |
143 | 143 | $field = 'mimepart'; |
144 | - $value = (int)$this->mimetypeLoader->getId($matches[1]); |
|
144 | + $value = (int) $this->mimetypeLoader->getId($matches[1]); |
|
145 | 145 | $type = ISearchComparison::COMPARE_EQUAL; |
146 | 146 | } else if (strpos($value, '%') !== false) { |
147 | - throw new \InvalidArgumentException('Unsupported query value for mimetype: ' . $value . ', only values in the format "mime/type" or "mime/%" are supported'); |
|
147 | + throw new \InvalidArgumentException('Unsupported query value for mimetype: '.$value.', only values in the format "mime/type" or "mime/%" are supported'); |
|
148 | 148 | } else { |
149 | 149 | $field = 'mimetype'; |
150 | - $value = (int)$this->mimetypeLoader->getId($value); |
|
150 | + $value = (int) $this->mimetypeLoader->getId($value); |
|
151 | 151 | $type = ISearchComparison::COMPARE_EQUAL; |
152 | 152 | } |
153 | 153 | } |
@@ -181,14 +181,14 @@ discard block |
||
181 | 181 | ]; |
182 | 182 | |
183 | 183 | if (!isset($types[$operator->getField()])) { |
184 | - throw new \InvalidArgumentException('Unsupported comparison field ' . $operator->getField()); |
|
184 | + throw new \InvalidArgumentException('Unsupported comparison field '.$operator->getField()); |
|
185 | 185 | } |
186 | 186 | $type = $types[$operator->getField()]; |
187 | 187 | if (gettype($operator->getValue()) !== $type) { |
188 | - throw new \InvalidArgumentException('Invalid type for field ' . $operator->getField()); |
|
188 | + throw new \InvalidArgumentException('Invalid type for field '.$operator->getField()); |
|
189 | 189 | } |
190 | 190 | if (!in_array($operator->getType(), $comparisons[$operator->getField()])) { |
191 | - throw new \InvalidArgumentException('Unsupported comparison for field ' . $operator->getField() . ': ' . $operator->getType()); |
|
191 | + throw new \InvalidArgumentException('Unsupported comparison for field '.$operator->getField().': '.$operator->getType()); |
|
192 | 192 | } |
193 | 193 | } |
194 | 194 |