Skip to content

Commit

Permalink
Remove call_user_func
Browse files Browse the repository at this point in the history
  • Loading branch information
enumag committed Mar 17, 2017
1 parent 280d7c5 commit 346f245
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/EntityLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function filterIn(string $type, $parameter)

private function getFilter(string $type): FilterInInterface
{
$filter = call_user_func($this->filterInResolver, $type);
$filter = ($this->filterInResolver)($type);
if (!$filter) {
throw new UnexpectedValueException("No filter in found for type '$type'.");
}
Expand Down
2 changes: 1 addition & 1 deletion src/EntityUnloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function filterOut($object)

private function getFilter(string $type): FilterOutInterface
{
$filter = call_user_func($this->filterOutResolver, $type);
$filter = ($this->filterOutResolver)($type);
if (!$filter) {
throw new UnexpectedValueException("No filter out found for type '$type'.");
}
Expand Down
4 changes: 2 additions & 2 deletions src/Routing/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ public function __construct($mask, $metadata = [], $flags = 0)
if (isset($metadata[null][self::FILTER_OUT])) {
$original = $metadata[null][self::FILTER_OUT];
$metadata[null][self::FILTER_OUT] = function (array $parameters) use ($original, $filter) {
$parameters = call_user_func($original, $parameters);
$parameters = $original($parameters);
if (!is_array($parameters)) {
return $parameters;
}

return call_user_func($filter, $parameters);
return $filter($parameters);
};
} else {
$metadata[null][self::FILTER_OUT] = $filter;
Expand Down

0 comments on commit 346f245

Please sign in to comment.