Skip to content

Commit a9949d3

Browse files
authored
Merge pull request #77 from chadicus/master
Fix bug with custom error
2 parents 3118272 + 0ff220b commit a9949d3

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/Filterer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ private static function assertFilterIsNotArray($filter, string $field)
414414
}
415415
}
416416

417-
private static function validateCustomError(array $filters, string $field)
417+
private static function validateCustomError(array &$filters, string $field)
418418
{
419419
$customError = null;
420420
if (array_key_exists('error', $filters)) {

tests/FiltererTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,8 @@ public function filterWithCustomError()
405405
$result = Filterer::filter(
406406
[
407407
'fieldOne' => [
408+
'error' => 'My custom error message',
408409
['\TraderInteractive\FiltererTest::failingFilter'],
409-
'error' => 'My custom error message'
410410
],
411411
],
412412
['fieldOne' => 'valueOne']

0 commit comments

Comments
 (0)