@@ -22,13 +22,13 @@ |
||
22 | 22 | /** @var int How log interval is preset after correct response */ |
23 | 23 | protected int $timeout = 0; |
24 | 24 | |
25 | - public function __construct(ArrayAccess &$session, int $timeout = 0) |
|
25 | + public function __construct(ArrayAccess & $session, int $timeout = 0) |
|
26 | 26 | { |
27 | 27 | $this->session = $session; |
28 | 28 | $this->timeout = $timeout; |
29 | 29 | $this->time = ($this->session->offsetExists(static::CAPTCHA_TIME)) |
30 | 30 | ? intval(strval($this->session->offsetGet(static::CAPTCHA_TIME))) |
31 | - : 0 ; |
|
31 | + : 0; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | public function updateExpire(): void |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | protected string $renderError = 'Cannot render captcha image!'; |
21 | 21 | protected ?ArrayAccess $session = null; |
22 | 22 | |
23 | - protected function fillSession(string $alias, ArrayAccess &$session, string $text): void |
|
23 | + protected function fillSession(string $alias, ArrayAccess & $session, string $text): void |
|
24 | 24 | { |
25 | 25 | $stringNow = $alias . '_now'; |
26 | 26 | $stringLast = $alias . '_last'; |
@@ -94,8 +94,8 @@ discard block |
||
94 | 94 | */ |
95 | 95 | protected function generateRandomString(int $stringLength = 16): string |
96 | 96 | { |
97 | - $all = ['1','2','3','4','5','6','7','8','9','0','a','b','c','d','e','f','g','h','i', |
|
98 | - 'j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','!','$','%']; |
|
97 | + $all = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', |
|
98 | + 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '!', '$', '%']; |
|
99 | 99 | $string = ''; |
100 | 100 | for ($i = 0; $i < $stringLength; $i++) { |
101 | 101 | $rand = mt_rand(0, count($all) - 1); |
@@ -21,7 +21,7 @@ |
||
21 | 21 | /** @var array<string, string> Token cache */ |
22 | 22 | protected array $tokens = []; |
23 | 23 | |
24 | - public function init(ArrayAccess &$cookie, int $expire = 3600): void |
|
24 | + public function init(ArrayAccess & $cookie, int $expire = 3600): void |
|
25 | 25 | { |
26 | 26 | if (empty($cookie['csrf_token'])) { |
27 | 27 | $cookie['csrf_token'] = uniqid('csrf', true); |
@@ -17,7 +17,7 @@ |
||
17 | 17 | protected ?ArrayAccess $session = null; |
18 | 18 | protected int $expire = 3600; |
19 | 19 | |
20 | - public function init(ArrayAccess &$session, int $expire = 3600): void |
|
20 | + public function init(ArrayAccess & $session, int $expire = 3600): void |
|
21 | 21 | { |
22 | 22 | $this->session = $session; |
23 | 23 | $this->expire = $expire; |