@@ -117,9 +117,9 @@ public function sort(Sorting $sorting): IDataSource
117117
118118 foreach ($ this ->data as $ item ) {
119119 $ value = is_object ($ item ) ? $ item ->$ column : $ item [$ column ]; // @phpstan-ignore-line
120- $ sort_by = $ value instanceof DateTimeInterface ? $ value ->format ('Y-m-d H:i:s ' ) : (string ) $ value ;
120+ $ sortBy = $ value instanceof DateTimeInterface ? $ value ->format ('Y-m-d H:i:s ' ) : (string ) $ value ;
121121
122- $ data [$ sort_by ][] = $ item ;
122+ $ data [$ sortBy ][] = $ item ;
123123 }
124124
125125 if ($ order === 'ASC ' ) {
@@ -177,12 +177,12 @@ protected function applyFilter(mixed $row, Filter $filter): mixed
177177
178178 $ words = $ filter instanceof FilterText && $ filter ->hasSplitWordsSearch () === false ? [$ value ] : explode (' ' , $ value );
179179
180- $ row_value = strtolower (Strings::toAscii ((string ) $ row [$ column ]));
180+ $ rowValue = strtolower (Strings::toAscii ((string ) $ row [$ column ]));
181181
182182 $ found = [];
183183
184184 foreach ($ words as $ word ) {
185- if (str_contains ($ row_value , strtolower (Strings::toAscii ($ word )))) {
185+ if (str_contains ($ rowValue , strtolower (Strings::toAscii ($ word )))) {
186186 if ($ filter instanceof FilterText && !$ filter ->hasConjunctionSearch ()) {
187187 return $ row ;
188188 } else {
@@ -233,22 +233,22 @@ protected function applyFilterDateRange(mixed $row, FilterDateRange $filter): bo
233233 $ format = $ filter ->getPhpFormat ();
234234 $ condition = $ filter ->getCondition ();
235235 $ values = $ condition [$ filter ->getColumn ()];
236- $ row_value = $ row [$ filter ->getColumn ()];
236+ $ rowValue = $ row [$ filter ->getColumn ()];
237237
238238 if ($ values ['from ' ] !== null && $ values ['from ' ] !== '' ) {
239239 try {
240- $ date_from = DateTimeHelper::tryConvertToDate ($ values ['from ' ], [$ format ]);
241- $ date_from ->setTime (0 , 0 , 0 );
240+ $ dateFrom = DateTimeHelper::tryConvertToDate ($ values ['from ' ], [$ format ]);
241+ $ dateFrom ->setTime (0 , 0 , 0 );
242242 } catch (DatagridDateTimeHelperException ) {
243243 return false ;
244244 }
245245
246- if (!($ row_value instanceof DateTime)) {
246+ if (!($ rowValue instanceof DateTime)) {
247247 /**
248248 * Try to convert string to DateTime object
249249 */
250250 try {
251- $ row_value = DateTimeHelper::tryConvertToDate ($ row_value );
251+ $ rowValue = DateTimeHelper::tryConvertToDate ($ rowValue );
252252 } catch (DatagridDateTimeHelperException ) {
253253 /**
254254 * Otherwise just return raw string
@@ -257,25 +257,25 @@ protected function applyFilterDateRange(mixed $row, FilterDateRange $filter): bo
257257 }
258258 }
259259
260- if ($ row_value ->getTimestamp () < $ date_from ->getTimestamp ()) {
260+ if ($ rowValue ->getTimestamp () < $ dateFrom ->getTimestamp ()) {
261261 return false ;
262262 }
263263 }
264264
265265 if ($ values ['to ' ] !== null && $ values ['to ' ] !== '' ) {
266266 try {
267- $ date_to = DateTimeHelper::tryConvertToDate ($ values ['to ' ], [$ format ]);
268- $ date_to ->setTime (23 , 59 , 59 );
267+ $ dateTo = DateTimeHelper::tryConvertToDate ($ values ['to ' ], [$ format ]);
268+ $ dateTo ->setTime (23 , 59 , 59 );
269269 } catch (DatagridDateTimeHelperException ) {
270270 return false ;
271271 }
272272
273- if (!($ row_value instanceof DateTime)) {
273+ if (!($ rowValue instanceof DateTime)) {
274274 /**
275275 * Try to convert string to DateTime object
276276 */
277277 try {
278- $ row_value = DateTimeHelper::tryConvertToDate ($ row_value );
278+ $ rowValue = DateTimeHelper::tryConvertToDate ($ rowValue );
279279 } catch (DatagridDateTimeHelperException ) {
280280 /**
281281 * Otherwise just return raw string
@@ -284,7 +284,7 @@ protected function applyFilterDateRange(mixed $row, FilterDateRange $filter): bo
284284 }
285285 }
286286
287- if ($ row_value ->getTimestamp () > $ date_to ->getTimestamp ()) {
287+ if ($ rowValue ->getTimestamp () > $ dateTo ->getTimestamp ()) {
288288 return false ;
289289 }
290290 }
@@ -301,20 +301,20 @@ protected function applyFilterDate(mixed $row, FilterDate $filter): bool
301301 $ condition = $ filter ->getCondition ();
302302
303303 foreach ($ condition as $ column => $ value ) {
304- $ row_value = $ row [$ column ];
304+ $ rowValue = $ row [$ column ];
305305
306306 try {
307307 $ date = DateTimeHelper::tryConvertToDateTime ($ value , [$ format ]);
308308 } catch (DatagridDateTimeHelperException ) {
309309 return false ;
310310 }
311311
312- if (!($ row_value instanceof DateTime)) {
312+ if (!($ rowValue instanceof DateTime)) {
313313 /**
314314 * Try to convert string to DateTime object
315315 */
316316 try {
317- $ row_value = DateTimeHelper::tryConvertToDateTime ($ row_value );
317+ $ rowValue = DateTimeHelper::tryConvertToDateTime ($ rowValue );
318318 } catch (DatagridDateTimeHelperException ) {
319319 /**
320320 * Otherwise just return raw string
@@ -323,7 +323,7 @@ protected function applyFilterDate(mixed $row, FilterDate $filter): bool
323323 }
324324 }
325325
326- return $ row_value ->format ($ format ) === $ date ->format ($ format );
326+ return $ rowValue ->format ($ format ) === $ date ->format ($ format );
327327 }
328328
329329 return false ;
0 commit comments