Skip to content

Commit

Permalink
Use array_map() instead of walk.
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
  • Loading branch information
crynobone committed Nov 7, 2013
1 parent 1497058 commit 9ecbe1a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Orchestra/Support/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ protected function getBindedRules()
$rules = $this->rules;
$bindings = $this->prepareBindings('{', '}');

$filter = function (& $value, $key, $bindings) {
$value = strtr($value, $bindings);
$filter = function ($value) use ($bindings) {
return strtr($value, $bindings);
};

foreach ($rules as $key => $value) {
if (is_array($value)) {
array_walk($value, $filter, $bindings);
$value = array_map($filter, $value);
} else {
$value = strtr($value, $bindings);
}
Expand Down

0 comments on commit 9ecbe1a

Please sign in to comment.