/**
* Signs the given value with the signature secret.
*
- * @param string $value
* @throws CryptoException
*/
- public static function getSignature($value): string
+ public static function getSignature(string $value): string
{
if (\mb_strlen(SIGNATURE_SECRET, '8bit') < 15) {
throw new CryptoException('SIGNATURE_SECRET is too short, aborting.');
/**
* Creates a signed (signature + encoded value) string.
- *
- * @param string $value
*/
- public static function createSignedString($value): string
+ public static function createSignedString(string $value): string
{
return self::getSignature($value) . '-' . Base64::encode($value);
}
/**
* Returns whether the given string is a proper signed string.
* (i.e. consists of a valid signature + encoded value)
- *
- * @param string $string
*/
- public static function validateSignedString($string): bool
+ public static function validateSignedString(string $string): bool
{
$parts = \explode('-', $string, 2);
if (\count($parts) !== 2) {
*
* - Returns null if the string is not properly signed.
*
- * @param string $string
* @see \wcf\util\CryptoUtil::validateSignedString()
*/
- public static function getValueFromSignedString($string): ?string
+ public static function getValueFromSignedString(string $string): ?string
{
if (!self::validateSignedString($string)) {
return null;