Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/password_policy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2022-05-12 14:47:40 +0300
committerVincent Petry <vincent@nextcloud.com>2022-05-12 14:47:40 +0300
commit84a258df288084b7c8d38cb5645dfd38f71ea925 (patch)
treeeeab5748bdc6f9bcaea7924b0f986b4dfe58bcee
parentc6c89f8664d0e7903e90be28ba991a615ecdf756 (diff)
Use max() function for more compact code!
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
-rw-r--r--lib/Generator.php6
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 = '';