8000 [Security] Avoid unnecessary usage of Reflection · symfony/symfony@2377418 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2377418

Browse files
committed
[Security] Avoid unnecessary usage of Reflection
1 parent 36041a8 commit 2377418

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Symfony/Component/Security/Core/Encoder/EncoderFactory.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ private function createEncoder(array $config, bool $isExtra = false): PasswordEn
7878
throw new \InvalidArgumentException(sprintf('"arguments" must be set in %s.', json_encode($config)));
7979
}
8080

81-
$reflection = new \ReflectionClass($config['class']);
82-
83-
$encoder = $reflection->newInstanceArgs($config['arguments']);
81+
$encoder = new $config['class'](...$config['arguments']);
8482

8583
if ($isExtra || !\in_array($config['class'], [NativePasswordEncoder::class, SodiumPasswordEncoder::class], true)) {
8684
return $encoder;

0 commit comments

Comments
 (0)
0