Skip to content

Commit

Permalink
Allow default values for filter methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandeesh committed May 22, 2017
1 parent 3f7ef19 commit 3a76b52
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/RealWorld/Filters/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ public function apply(Builder $builder)

foreach ($this->getFilters() as $name => $value) {
if (method_exists($this, $name)) {
$this->$name($value);
if ($value) {
$this->$name($value);
} else {
$this->$name();
}
}
}

Expand Down

0 comments on commit 3a76b52

Please sign in to comment.