aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/spomky-labs/otphp/src
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-09-30 07:11:05 +0000
committerMario <mario@mariovavti.com>2024-09-30 07:11:05 +0000
commit3f411787c1436e2259efb184c0f84b13f4244fb0 (patch)
treeafb3777ac9ba95d9c30c4dbb66ea82e0c6636f79 /vendor/spomky-labs/otphp/src
parent5782a674b0cb490f1e3544e5dcb0f7e969361df3 (diff)
downloadvolse-hubzilla-3f411787c1436e2259efb184c0f84b13f4244fb0.tar.gz
volse-hubzilla-3f411787c1436e2259efb184c0f84b13f4244fb0.tar.bz2
volse-hubzilla-3f411787c1436e2259efb184c0f84b13f4244fb0.zip
update spomky-labs/otphp
Diffstat (limited to 'vendor/spomky-labs/otphp/src')
-rw-r--r--vendor/spomky-labs/otphp/src/Factory.php4
-rw-r--r--vendor/spomky-labs/otphp/src/OTP.php10
-rw-r--r--vendor/spomky-labs/otphp/src/ParameterTrait.php2
-rw-r--r--vendor/spomky-labs/otphp/src/TOTP.php34
-rw-r--r--vendor/spomky-labs/otphp/src/Url.php2
5 files changed, 25 insertions, 27 deletions
diff --git a/vendor/spomky-labs/otphp/src/Factory.php b/vendor/spomky-labs/otphp/src/Factory.php
index 409d8751e..f58e8385c 100644
--- a/vendor/spomky-labs/otphp/src/Factory.php
+++ b/vendor/spomky-labs/otphp/src/Factory.php
@@ -4,10 +4,10 @@ declare(strict_types=1);
namespace OTPHP;
-use function assert;
-use function count;
use InvalidArgumentException;
use Throwable;
+use function assert;
+use function count;
/**
* This class is used to load OTP object from a provisioning Uri.
diff --git a/vendor/spomky-labs/otphp/src/OTP.php b/vendor/spomky-labs/otphp/src/OTP.php
index 4765d49eb..944ed8f62 100644
--- a/vendor/spomky-labs/otphp/src/OTP.php
+++ b/vendor/spomky-labs/otphp/src/OTP.php
@@ -4,14 +4,14 @@ declare(strict_types=1);
namespace OTPHP;
-use function assert;
-use function chr;
-use function count;
use Exception;
use InvalidArgumentException;
-use function is_string;
use ParagonIE\ConstantTime\Base32;
use RuntimeException;
+use function assert;
+use function chr;
+use function count;
+use function is_string;
use const STR_PAD_LEFT;
abstract class OTP implements OTPInterface
@@ -100,7 +100,7 @@ abstract class OTP implements OTPInterface
$this->hasColon($label) === false || throw new InvalidArgumentException('Label must not contain a colon.');
$options = [...$options, ...$this->getParameters()];
$this->filterOptions($options);
- $params = str_replace(['+', '%7E'], ['%20', '~'], http_build_query($options));
+ $params = str_replace(['+', '%7E'], ['%20', '~'], http_build_query($options, '', '&'));
return sprintf(
'otpauth://%s/%s?%s',
diff --git a/vendor/spomky-labs/otphp/src/ParameterTrait.php b/vendor/spomky-labs/otphp/src/ParameterTrait.php
index 3b2641e0c..dc92861c4 100644
--- a/vendor/spomky-labs/otphp/src/ParameterTrait.php
+++ b/vendor/spomky-labs/otphp/src/ParameterTrait.php
@@ -4,10 +4,10 @@ declare(strict_types=1);
namespace OTPHP;
+use InvalidArgumentException;
use function array_key_exists;
use function assert;
use function in_array;
-use InvalidArgumentException;
use function is_int;
use function is_string;
diff --git a/vendor/spomky-labs/otphp/src/TOTP.php b/vendor/spomky-labs/otphp/src/TOTP.php
index 3a7d72870..8a1cfeba1 100644
--- a/vendor/spomky-labs/otphp/src/TOTP.php
+++ b/vendor/spomky-labs/otphp/src/TOTP.php
@@ -4,8 +4,8 @@ declare(strict_types=1);
namespace OTPHP;
-use function assert;
use InvalidArgumentException;
+use function assert;
use function is_int;
/**
@@ -133,23 +133,21 @@ final class TOTP extends OTP implements TOTPInterface
*/
protected function getParameterMap(): array
{
- return array_merge(
- parent::getParameterMap(),
- [
- 'period' => static function ($value): int {
- (int) $value > 0 || throw new InvalidArgumentException('Period must be at least 1.');
-
- return (int) $value;
- },
- 'epoch' => static function ($value): int {
- (int) $value >= 0 || throw new InvalidArgumentException(
- 'Epoch must be greater than or equal to 0.'
- );
-
- return (int) $value;
- },
- ]
- );
+ return [
+ ...parent::getParameterMap(),
+ 'period' => static function ($value): int {
+ (int) $value > 0 || throw new InvalidArgumentException('Period must be at least 1.');
+
+ return (int) $value;
+ },
+ 'epoch' => static function ($value): int {
+ (int) $value >= 0 || throw new InvalidArgumentException(
+ 'Epoch must be greater than or equal to 0.'
+ );
+
+ return (int) $value;
+ },
+ ];
}
/**
diff --git a/vendor/spomky-labs/otphp/src/Url.php b/vendor/spomky-labs/otphp/src/Url.php
index 76919d27a..a97ca6821 100644
--- a/vendor/spomky-labs/otphp/src/Url.php
+++ b/vendor/spomky-labs/otphp/src/Url.php
@@ -4,8 +4,8 @@ declare(strict_types=1);
namespace OTPHP;
-use function array_key_exists;
use InvalidArgumentException;
+use function array_key_exists;
use function is_string;
/**