aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/spomky-labs/otphp/src/Factory.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-05-30 08:36:17 +0000
committerMario <mario@mariovavti.com>2023-05-30 08:36:17 +0000
commitb9812ba06ac16899df2a25f0abf25962ae3273f2 (patch)
tree35762d0183f5b0c6d866b00cdeebfbae595cfa56 /vendor/spomky-labs/otphp/src/Factory.php
parentbc6aded074156ec81084334a4d6aa58bc0f37a68 (diff)
downloadvolse-hubzilla-b9812ba06ac16899df2a25f0abf25962ae3273f2.tar.gz
volse-hubzilla-b9812ba06ac16899df2a25f0abf25962ae3273f2.tar.bz2
volse-hubzilla-b9812ba06ac16899df2a25f0abf25962ae3273f2.zip
update composer libs
Diffstat (limited to 'vendor/spomky-labs/otphp/src/Factory.php')
-rw-r--r--vendor/spomky-labs/otphp/src/Factory.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/vendor/spomky-labs/otphp/src/Factory.php b/vendor/spomky-labs/otphp/src/Factory.php
index d5c60cc34..409d8751e 100644
--- a/vendor/spomky-labs/otphp/src/Factory.php
+++ b/vendor/spomky-labs/otphp/src/Factory.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace OTPHP;
+use function assert;
use function count;
use InvalidArgumentException;
use Throwable;
@@ -55,6 +56,9 @@ final class Factory implements FactoryInterface
);
$otp->setIssuerIncludedAsParameter(true);
}
+
+ assert($result[0] !== '');
+
$otp->setIssuer($result[0]);
}
@@ -76,10 +80,16 @@ final class Factory implements FactoryInterface
}
}
+ /**
+ * @param non-empty-string $data
+ * @return non-empty-string
+ */
private static function getLabel(string $data): string
{
$result = explode(':', rawurldecode(mb_substr($data, 1)));
+ $label = count($result) === 2 ? $result[1] : $result[0];
+ assert($label !== '');
- return count($result) === 2 ? $result[1] : $result[0];
+ return $label;
}
}