Skip to content

Commit 4552cb9

Browse files
committed
Upgrade coding standard
1 parent 87b3dfa commit 4552cb9

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
},
4141
"require-dev": {
4242
"ext-xdebug": "*",
43-
"aplus/coding-standard": "^2.1",
43+
"aplus/coding-standard": "^2.8",
4444
"ergebnis/composer-normalize": "^2.15",
4545
"phpmd/phpmd": "^2.13",
4646
"phpstan/phpstan": "^1.9",

src/Box.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function __construct(
4646
#[SensitiveParameter]
4747
string $publicKey,
4848
#[SensitiveParameter]
49-
string $nonce = null
49+
?string $nonce = null
5050
) {
5151
$this->secretKey = $secretKey;
5252
$this->publicKey = $publicKey;
@@ -128,7 +128,7 @@ public function encrypt(
128128
#[SensitiveParameter]
129129
string $message,
130130
#[SensitiveParameter]
131-
string $nonce = null
131+
?string $nonce = null
132132
) : string {
133133
return \sodium_crypto_box(
134134
$message,
@@ -155,7 +155,7 @@ public function decrypt(
155155
#[SensitiveParameter]
156156
string $ciphertext,
157157
#[SensitiveParameter]
158-
string $nonce = null
158+
?string $nonce = null
159159
) : false | string {
160160
return \sodium_crypto_box_open(
161161
$ciphertext,

src/GenericHash.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ protected function validateHashLength(int $length) : void
103103
public function signature(
104104
#[SensitiveParameter]
105105
string $message,
106-
int $hashLength = null
106+
?int $hashLength = null
107107
) : string {
108108
return Utils::bin2base64(
109109
$this->makeHash($message, $hashLength),
@@ -129,7 +129,7 @@ public function verify(
129129
string $message,
130130
#[SensitiveParameter]
131131
string $signature,
132-
int $hashLength = null
132+
?int $hashLength = null
133133
) : bool {
134134
return \hash_equals(
135135
$this->makeHash($message, $hashLength),
@@ -149,7 +149,7 @@ public function verify(
149149
*
150150
* @return string
151151
*/
152-
protected function makeHash(#[SensitiveParameter] string $message, int $length = null) : string
152+
protected function makeHash(#[SensitiveParameter] string $message, ?int $length = null) : string
153153
{
154154
if ($length !== null) {
155155
$this->validateHashLength($length);

src/Password.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ class Password
5858
public static function hash(
5959
#[SensitiveParameter]
6060
string $password,
61-
int $opslimit = null,
62-
int $memlimit = null
61+
?int $opslimit = null,
62+
?int $memlimit = null
6363
) : string {
6464
$opslimit ??= static::getOpsLimit();
6565
$memlimit ??= static::getMemLimit();
@@ -84,8 +84,8 @@ public static function hash(
8484
public static function needsRehash(
8585
#[SensitiveParameter]
8686
string $hash,
87-
int $opslimit = null,
88-
int $memlimit = null
87+
?int $opslimit = null,
88+
?int $memlimit = null
8989
) : bool {
9090
$opslimit ??= static::getOpsLimit();
9191
$memlimit ??= static::getMemLimit();

0 commit comments

Comments
 (0)