Skip to content

Commit

Permalink
Remove type declarations
Browse files Browse the repository at this point in the history
There's no way to make them nullable in PHP 5, so it's our only way forward.

I _could_ add runtime type checks, but why bother?
  • Loading branch information
paragonie-security committed Apr 17, 2024
1 parent c9fe6f8 commit f98291a
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions src/Core/Curve25519/Ge/Cached.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ class ParagonIE_Sodium_Core_Curve25519_Ge_Cached
* @param ParagonIE_Sodium_Core_Curve25519_Fe|null $T2d
*/
public function __construct(
ParagonIE_Sodium_Core_Curve25519_Fe $YplusX = null,
ParagonIE_Sodium_Core_Curve25519_Fe $YminusX = null,
ParagonIE_Sodium_Core_Curve25519_Fe $Z = null,
ParagonIE_Sodium_Core_Curve25519_Fe $T2d = null
$YplusX = null,
$YminusX = null,
$Z = null,
$T2d = null
) {
if ($YplusX === null) {
$YplusX = new ParagonIE_Sodium_Core_Curve25519_Fe();
Expand Down
8 changes: 4 additions & 4 deletions src/Core/Curve25519/Ge/P1p1.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ class ParagonIE_Sodium_Core_Curve25519_Ge_P1p1
* @param ParagonIE_Sodium_Core_Curve25519_Fe|null $t
*/
public function __construct(
ParagonIE_Sodium_Core_Curve25519_Fe $x = null,
ParagonIE_Sodium_Core_Curve25519_Fe $y = null,
ParagonIE_Sodium_Core_Curve25519_Fe $z = null,
ParagonIE_Sodium_Core_Curve25519_Fe $t = null
$x = null,
$y = null,
$z = null,
$t = null
) {
if ($x === null) {
$x = new ParagonIE_Sodium_Core_Curve25519_Fe();
Expand Down
6 changes: 3 additions & 3 deletions src/Core/Curve25519/Ge/P2.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ class ParagonIE_Sodium_Core_Curve25519_Ge_P2
* @param ParagonIE_Sodium_Core_Curve25519_Fe|null $z
*/
public function __construct(
ParagonIE_Sodium_Core_Curve25519_Fe $x = null,
ParagonIE_Sodium_Core_Curve25519_Fe $y = null,
ParagonIE_Sodium_Core_Curve25519_Fe $z = null
$x = null,
$y = null,
$z = null
) {
if ($x === null) {
$x = new ParagonIE_Sodium_Core_Curve25519_Fe();
Expand Down
8 changes: 4 additions & 4 deletions src/Core/Curve25519/Ge/P3.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ class ParagonIE_Sodium_Core_Curve25519_Ge_P3
* @param ParagonIE_Sodium_Core_Curve25519_Fe|null $t
*/
public function __construct(
ParagonIE_Sodium_Core_Curve25519_Fe $x = null,
ParagonIE_Sodium_Core_Curve25519_Fe $y = null,
ParagonIE_Sodium_Core_Curve25519_Fe $z = null,
ParagonIE_Sodium_Core_Curve25519_Fe $t = null
$x = null,
$y = null,
$z = null,
$t = null
) {
if ($x === null) {
$x = new ParagonIE_Sodium_Core_Curve25519_Fe();
Expand Down
6 changes: 3 additions & 3 deletions src/Core/Curve25519/Ge/Precomp.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ class ParagonIE_Sodium_Core_Curve25519_Ge_Precomp
* @param ParagonIE_Sodium_Core_Curve25519_Fe $xy2d
*/
public function __construct(
ParagonIE_Sodium_Core_Curve25519_Fe $yplusx = null,
ParagonIE_Sodium_Core_Curve25519_Fe $yminusx = null,
ParagonIE_Sodium_Core_Curve25519_Fe $xy2d = null
$yplusx = null,
$yminusx = null,
$xy2d = null
) {
if ($yplusx === null) {
$yplusx = new ParagonIE_Sodium_Core_Curve25519_Fe();
Expand Down

0 comments on commit f98291a

Please sign in to comment.