Skip to content

Commit ed6e6c5

Browse files
committed
Make use first-class callable
1 parent 665db2a commit ed6e6c5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Key/Transformer/PublicKey/RsaPublicKeyTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function transform(KeyInterface $privateKey): KeyInterface
5959
throw new InvalidArgumentException($message);
6060
}
6161

62-
$parameters = array_filter($privateKey->getParameters(), [$this, 'isPublic']);
62+
$parameters = array_filter($privateKey->getParameters(), $this->isPublic(...));
6363
$key = new Key($parameters);
6464

6565
if ($key->has(Operations::NAME)) {

src/Key/Transformer/SecLib/RsaSecLibTransformer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ protected function toComponents(array $parameters): array
6363
throw new InvalidKeyException('Exponent and/or modulus not found.');
6464
}
6565

66-
return array_map([$this, 'toComponent'], $parameters);
66+
return array_map($this->toComponent(...), $parameters);
6767
}
6868

6969
#[Override]
@@ -86,7 +86,7 @@ protected function fromComponents(array $components): array
8686
$notNull,
8787
);
8888

89-
$parameters = array_map([$this, 'fromComponent'], $flattedComponents);
89+
$parameters = array_map($this->fromComponent(...), $flattedComponents);
9090

9191
$exponentExists = array_key_exists(PublicExponent::NAME, $parameters);
9292
$modulusExists = array_key_exists(Modulus::NAME, $parameters);

0 commit comments

Comments
 (0)