Further syntax errors

master
Brady McDonough 2 years ago
parent bf87bebfa8
commit ce527bbdeb

@ -20,7 +20,7 @@ class HMAC_SHA1 implements HashInterface
return $this->hash($key, \dechex($val));
}
public function hashType(): string
public static function hashType(): string
{
return "SHA1";
}
@ -28,7 +28,7 @@ class HMAC_SHA1 implements HashInterface
/** @SuppressWarnings(PHPMD.StaticAccess) */
public static function keygen(): string
{
return Base32::encodeUpper(random_bytes(this.DEFAULT_SECRET_SIZE));
return Base32::encodeUpper(random_bytes(this::DEFAULT_SECRET_SIZE));
}
}

@ -6,7 +6,7 @@ interface HashInterface
{
public function hash(string $key, string $val): string;
public function hashNumeric(string $key, int $val): string;
public function hashType(): string;
public static function hashType(): string;
public static function keygen(): string;
}

@ -47,7 +47,7 @@ interface PersistenceInterface
* @param mixed $index Whatever data needed to index into your database and identify a particular user
* @return null|string
*/
public function getSecret(mixed $index): null|string;
public function getSecret(mixed $index): ?string;
/**
* Gets and returns the last successful challenge timestamp to enforce the One-Time aspect of a TOTP.

@ -40,7 +40,12 @@ class Base implements SessionInterface
public function get(string $key): mixed
{
return $_SESSION[$this->prefix($key)];
$key = $this->prefix($key);
if (isset($_SESSION[$key]))
{
return $_SESSION[$key];
}
return null;
}
}

Loading…
Cancel
Save