Skip to content

Commit dcd9aa9

Browse files
committed
Cleanup of AuthToken Var statements
1 parent eb73c31 commit dcd9aa9

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

docs/references/authentication/hmac.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ You will also be able to adjust the default Driver `$hmacEncryptionDefaultDriver
170170
overridden for an individual key by including them in the keys array.
171171

172172
```php
173-
public array $hmacEncryptionKeys = [
173+
public $hmacEncryptionKeys = [
174174
'k1' => [
175175
'key' => 'hex2bin:923dfab5ddca0c7784c2c388a848a704f5e048736c1a852c862959da62ade8c7',
176176
],
@@ -188,7 +188,7 @@ encryption key. You will need to leave the old key in the array as it will be u
188188
during re-encryption.
189189

190190
```php
191-
public array $hmacEncryptionKeys = [
191+
public $hmacEncryptionKeys = [
192192
'k1' => [
193193
'key' => 'hex2bin:923dfab5ddca0c7784c2c388a848a704f5e048736c1a852c862959da62ade8c7',
194194
],

src/Config/BaseAuthToken.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class BaseAuthToken extends BaseConfig
1111
/**
1212
* List of HMAC Encryption Keys
1313
*
14-
* @var array|string
14+
* @var array<string, array{key: string, driver?: string, digest?: string}>|string
1515
*/
1616
public $hmacEncryptionKeys;
1717

@@ -39,11 +39,9 @@ public function __construct()
3939
*/
4040
protected function initEnvValue(&$property, string $name, string $prefix, string $shortPrefix): void
4141
{
42-
if ($name === 'hmacEncryptionKeys') {
43-
// if attempting to set property from ENV, first set to empty string
44-
if ($this->getEnvValue($name, $prefix, $shortPrefix) !== null) {
45-
$property = '';
46-
}
42+
// if attempting to set property from ENV, first set to empty string
43+
if ($name === 'hmacEncryptionKeys' && $this->getEnvValue($name, $prefix, $shortPrefix) !== null) {
44+
$property = '';
4745
}
4846

4947
parent::initEnvValue($property, $name, $prefix, $shortPrefix);

0 commit comments

Comments
 (0)