[Security] Avoid unnecessary usage of Reflection
This commit is contained in:
parent
36041a8858
commit
2377418443
@ -78,9 +78,7 @@ class EncoderFactory implements EncoderFactoryInterface
|
|||||||
throw new \InvalidArgumentException(sprintf('"arguments" must be set in %s.', json_encode($config)));
|
throw new \InvalidArgumentException(sprintf('"arguments" must be set in %s.', json_encode($config)));
|
||||||
}
|
}
|
||||||
|
|
||||||
$reflection = new \ReflectionClass($config['class']);
|
$encoder = new $config['class'](...$config['arguments']);
|
||||||
|
|
||||||
$encoder = $reflection->newInstanceArgs($config['arguments']);
|
|
||||||
|
|
||||||
if ($isExtra || !\in_array($config['class'], [NativePasswordEncoder::class, SodiumPasswordEncoder::class], true)) {
|
if ($isExtra || !\in_array($config['class'], [NativePasswordEncoder::class, SodiumPasswordEncoder::class], true)) {
|
||||||
return $encoder;
|
return $encoder;
|
||||||
|
Reference in New Issue
Block a user