Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
Password.php
1<?php
2
4
7
12final class Password
13{
14 private int $length;
15 private int $chars;
16 private string $value;
17
23 public function __construct(int $length = 32, int $chars = Random::ALPHABET_ALL)
24 {
25 if ($length <= 0)
26 {
27 throw new ArgumentException('Password cannot be empty');
28 }
29
30 $this->length = $length;
31 $this->chars = $chars;
32 $this->value = Random::getStringByAlphabet($this->length, $this->chars, true);
33 }
34
35 public function __toString()
36 {
37 return $this->value;
38 }
39}
__construct(int $length=32, int $chars=Random::ALPHABET_ALL)
Definition Password.php:23