Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

PHP 8.4 compat nits #182

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Core/AES/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ParagonIE_Sodium_Core_AES_Block extends SplFixedArray
/**
* @param int $size
*/
public function __construct($size = 8)
public function __construct(int $size = 8)
{
parent::__construct($size);
$this->size = $size;
Expand All @@ -50,7 +50,7 @@ public static function init(): self
* @psalm-suppress MethodSignatureMismatch
*/
#[ReturnTypeWillChange]
public static function fromArray($array, $save_indexes = null)
public static function fromArray($array, ?bool $save_indexes = null)
{
$count = count($array);
if ($save_indexes) {
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Curve25519/Fe.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function offsetUnset($offset): void
* @psalm-suppress ImplementedReturnTypeMismatch
*/
#[ReturnTypeWillChange]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What with the PHP minimum having been raised to PHP 8.1+, are the #[ReturnTypeWillChange] attributes still needed ? I'd think those can be removed now (and the return type added).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. We'll look at this in the future.

public function offsetGet($offset)
public function offsetGet($offset): int
{
if (!isset($this->container[$offset])) {
$this->container[$offset] = 0;
Expand Down
Loading