diff options
author | Vincent Petry <vincent@nextcloud.com> | 2022-05-12 14:47:40 +0300 |
---|---|---|
committer | Vincent Petry <vincent@nextcloud.com> | 2022-05-12 14:47:40 +0300 |
commit | 84a258df288084b7c8d38cb5645dfd38f71ea925 (patch) | |
tree | eeab5748bdc6f9bcaea7924b0f986b4dfe58bcee | |
parent | c6c89f8664d0e7903e90be28ba991a615ecdf756 (diff) |
Use max() function for more compact code!
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
-rw-r--r-- | lib/Generator.php | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/Generator.php b/lib/Generator.php index 062f0f9..ca9ea63 100644 --- a/lib/Generator.php +++ b/lib/Generator.php @@ -52,11 +52,7 @@ class Generator { * @throws HintException */ public function generate(): string { - $minLength = $this->config->getMinLength(); - if ($minLength < 8) { - // 8 minimum so we don't generate too short passwords - $minLength = 8; - } + $minLength = max($this->config->getMinLength(), 8); $length = $minLength; $password = ''; |