Skip to content

Commit

Permalink
Refactor to arrow function
Browse files Browse the repository at this point in the history
  • Loading branch information
olivervogel committed Apr 22, 2024
1 parent f4b377e commit a618334
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Format.php
Expand Up @@ -119,9 +119,7 @@ public function encoder(mixed ...$options): EncoderInterface
}

// filter only allowed options
$options = array_filter($options, function ($key) use ($parameters) {
return in_array($key, $parameters);
}, ARRAY_FILTER_USE_KEY);
$options = array_filter($options, fn ($key) => in_array($key, $parameters), ARRAY_FILTER_USE_KEY);

return new $classname(...$options);
}
Expand Down

0 comments on commit a618334

Please sign in to comment.