Skip to content

Commit

Permalink
[NEW] Added Filter::with(["filter1","filter2",...]) FCFS list support
Browse files Browse the repository at this point in the history
lastguest committed Nov 9, 2015

Verified

This commit was signed with the committer’s verified signature. The key has expired.
scrable Corey Russ
1 parent 4925be9 commit 4271ccb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions classes/Filter.php
Original file line number Diff line number Diff line change
@@ -32,7 +32,8 @@ public static function remove($name,callable $modder = null){
}
}

public static function with($name,$default){
public static function with($names, $default){
foreach ((array)$names as $name) {
if (false === empty(static::$_modders[$name])){
$value = $default;
$args = func_get_args();
@@ -41,9 +42,9 @@ public static function with($name,$default){
$value = call_user_func($modder,$value);
}
return $value;
} else {
return $default;
}
}
return $default;
}

}

0 comments on commit 4271ccb

Please sign in to comment.