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 b01eb1c commit f4b377e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Format.php
Expand Up @@ -112,9 +112,10 @@ public function encoder(mixed ...$options): EncoderInterface
$parameters = [];
$reflectionClass = new ReflectionClass($classname);
if ($constructor = $reflectionClass->getConstructor()) {
foreach ($constructor->getParameters() as $parameter) {
$parameters[] = $parameter->getName();
}
$parameters = array_map(
fn ($parameter) => $parameter->getName(),
$constructor->getParameters(),
);
}

// filter only allowed options
Expand Down

0 comments on commit f4b377e

Please sign in to comment.