Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in Filtry::make() #4

Merged
merged 1 commit into from
Aug 9, 2016
Merged

Bug in Filtry::make() #4

merged 1 commit into from
Aug 9, 2016

Conversation

dfbag7
Copy link

@dfbag7 dfbag7 commented Aug 8, 2016

Hello,

If use Filtry::make($input, $filters)->getFiltered() multiple times, it returns data merged from previous calls. Here is an example tinker session:

$php artisan tinker
>dump Filtry::make(['p1'=>'a'], ['p1'=>'trim'])->getFiltered()
array(1) {
  ["p1"]=>
  string(1) "a"
}
>dump Filtry::make(['p2'=>'a'], ['p2'=>'trim'])->getFiltered()
array(2) {
  ["p2"]=>
  string(1) "a"
  ["p1"]=>
  string(1) "a"
}

Note that the second usage of Filtry returns p1 which has not been passed.

So I'm suggesting a patch which solves the bug.

…mes, it returns data merged from previous calls.
@mjarestad mjarestad merged commit 5fcf1bd into mjarestad:master Aug 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants