Skip to content

Commit

Permalink
Upgrade coding standard
Browse files Browse the repository at this point in the history
  • Loading branch information
natanfelles committed Aug 23, 2024
1 parent 87b3dfa commit 4552cb9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
},
"require-dev": {
"ext-xdebug": "*",
"aplus/coding-standard": "^2.1",
"aplus/coding-standard": "^2.8",
"ergebnis/composer-normalize": "^2.15",
"phpmd/phpmd": "^2.13",
"phpstan/phpstan": "^1.9",
Expand Down
6 changes: 3 additions & 3 deletions src/Box.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function __construct(
#[SensitiveParameter]
string $publicKey,
#[SensitiveParameter]
string $nonce = null
?string $nonce = null
) {
$this->secretKey = $secretKey;
$this->publicKey = $publicKey;
Expand Down Expand Up @@ -128,7 +128,7 @@ public function encrypt(
#[SensitiveParameter]
string $message,
#[SensitiveParameter]
string $nonce = null
?string $nonce = null
) : string {
return \sodium_crypto_box(
$message,
Expand All @@ -155,7 +155,7 @@ public function decrypt(
#[SensitiveParameter]
string $ciphertext,
#[SensitiveParameter]
string $nonce = null
?string $nonce = null
) : false | string {
return \sodium_crypto_box_open(
$ciphertext,
Expand Down
6 changes: 3 additions & 3 deletions src/GenericHash.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected function validateHashLength(int $length) : void
public function signature(
#[SensitiveParameter]
string $message,
int $hashLength = null
?int $hashLength = null
) : string {
return Utils::bin2base64(
$this->makeHash($message, $hashLength),
Expand All @@ -129,7 +129,7 @@ public function verify(
string $message,
#[SensitiveParameter]
string $signature,
int $hashLength = null
?int $hashLength = null
) : bool {
return \hash_equals(
$this->makeHash($message, $hashLength),
Expand All @@ -149,7 +149,7 @@ public function verify(
*
* @return string
*/
protected function makeHash(#[SensitiveParameter] string $message, int $length = null) : string
protected function makeHash(#[SensitiveParameter] string $message, ?int $length = null) : string
{
if ($length !== null) {
$this->validateHashLength($length);
Expand Down
8 changes: 4 additions & 4 deletions src/Password.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class Password
public static function hash(
#[SensitiveParameter]
string $password,
int $opslimit = null,
int $memlimit = null
?int $opslimit = null,
?int $memlimit = null
) : string {
$opslimit ??= static::getOpsLimit();
$memlimit ??= static::getMemLimit();
Expand All @@ -84,8 +84,8 @@ public static function hash(
public static function needsRehash(
#[SensitiveParameter]
string $hash,
int $opslimit = null,
int $memlimit = null
?int $opslimit = null,
?int $memlimit = null
) : bool {
$opslimit ??= static::getOpsLimit();
$memlimit ??= static::getMemLimit();
Expand Down

0 comments on commit 4552cb9

Please sign in to comment.