@@ -133,29 +133,29 @@ protected function filterProperty(string $property, $value, QueryBuilder $queryB
133
133
$ wrapCase = $ this ->createWrapCase ($ caseSensitive );
134
134
$ valueParameter = $ queryNameGenerator ->generateParameterName ($ field );
135
135
136
- /**
137
- * If field type is string/float, Doctrine does not call convertToDatabaseValueSQL() because it
136
+ /*
137
+ * If field type is string/float, Doctrine does not call convertToDatabaseValueSQL() because it
138
138
* does not know it needs conversion.
139
139
* This would lead to incorrect values for Ramsey\Uuid\Doctrine\UuidBinaryType for example.
140
- * The only fix is to provide field type to doctrine ...
141
- * BUT it is not possible with setParameter(), as third arg can only be
140
+ * The only fix is to provide field type to doctrine ...
141
+ * BUT it is not possible with setParameter(), as third arg can only be
142
142
* \Doctrine\DBAL\Connection::PARAM_STR_ARRAY
143
- *
144
- * The only way to do this will be to rewrite the IN() statement to multiple values,
143
+ *
144
+ * The only way to do this will be to rewrite the IN() statement to multiple values,
145
145
* each provided as a single setParameter()
146
- ** /
146
+ */
147
147
148
148
// let's do a very simple query if we don't need the complex one (99% of time)
149
- if (in_array ($ metadata ->getTypeOfField ($ field ), ['string ' , 'integer ' ])) {
149
+ if (\ in_array ($ metadata ->getTypeOfField ($ field ), ['string ' , 'integer ' ], true )) {
150
150
$ queryBuilder
151
151
->andWhere (sprintf ($ wrapCase ('%s.%s ' ).' IN (:%s) ' , $ alias , $ field , $ valueParameter ))
152
152
->setParameter ($ valueParameter , $ caseSensitive ? $ values : array_map ('strtolower ' , $ values ));
153
153
} else {
154
154
$ inQuery = [];
155
- $ args = [];
155
+ $ args = [];
156
156
$ type = $ metadata ->getTypeOfField ($ field );
157
157
158
- for ($ i = 0 ; $ i <count ($ values ); $ i ++) {
158
+ for ($ i = 0 ; $ i < \ count ($ values ); $ i ++) {
159
159
$ inQuery [] = ':filterproperty ' .$ i ;
160
160
$ args [] = new Parameter ('filterproperty ' .$ i , $ caseSensitive ? $ values [$ i ] : strtolower ($ values [$ i ]), $ type );
161
161
}
@@ -169,7 +169,6 @@ protected function filterProperty(string $property, $value, QueryBuilder $queryB
169
169
->andWhere (sprintf ($ wrapCase ('%s.%s ' ).' IN (%s) ' , $ alias , $ field , implode (', ' , $ inQuery )))
170
170
->setParameters ($ parameters );
171
171
}
172
-
173
172
}
174
173
175
174
// metadata doesn't have the field, nor an association on the field
@@ -232,7 +231,6 @@ protected function addWhereByStrategy(string $strategy, QueryBuilder $queryBuild
232
231
}
233
232
$ wrapCase = $ this ->createWrapCase ($ caseSensitive );
234
233
$ valueParameter = $ queryNameGenerator ->generateParameterName ($ field );
235
-
236
234
237
235
switch ($ strategy ) {
238
236
case null :
0 commit comments