diff --git a/src/HOTP.php b/src/HOTP.php index e9c0c44..f4b2572 100644 --- a/src/HOTP.php +++ b/src/HOTP.php @@ -23,7 +23,7 @@ class HOTP */ public static function generateByCounter(string $key, int $counter): HOTPResult { - // the counter value can be more than one byte long, + // The counter value can be more than one byte long, // so we need to pack it down properly. $curCounter = [ 0, 0, 0, 0, 0, 0, 0, 0 ]; for ($i = 7; $i >= 0; $i--) { @@ -69,7 +69,7 @@ public static function generateByTime(string $key, int $window, $timestamp = fal * @param int $min the minimum window to accept before $timestamp * @param int $max the maximum window to accept after $timestamp * @param int|false $timestamp a timestamp to calculate for, defaults to time() - * @return array of HOTPResult + * @return HOTPResult[] */ public static function generateByTimeWindow(string $key, int $window, int $min = -1, int $max = 1, $timestamp = false): array { diff --git a/src/HOTPResult.php b/src/HOTPResult.php index ba731b2..caf10a7 100644 --- a/src/HOTPResult.php +++ b/src/HOTPResult.php @@ -19,11 +19,6 @@ class HOTPResult protected $decimal; protected $hex; - /** - * Build an HOTP Result - * @param string $value the value to construct with - * @codeCoverageIgnore - */ public function __construct(string $value) { // store raw @@ -32,7 +27,6 @@ public function __construct(string $value) /** * Returns the string version of the HOTP - * @return string */ public function toString(): string { @@ -41,7 +35,6 @@ public function toString(): string /** * Returns the hex version of the HOTP - * @return string */ public function toHex(): string { @@ -53,7 +46,6 @@ public function toHex(): string /** * Returns the decimal version of the HOTP - * @return int */ public function toDec(): int { diff --git a/tests/HOTPTest.php b/tests/HOTPTest.php index 2b3af50..1ded71a 100644 --- a/tests/HOTPTest.php +++ b/tests/HOTPTest.php @@ -9,6 +9,9 @@ * @copyright 2020 * @license BSD-3-Clause * @version 1.0 + * + * @covers \jakobo\HOTP\HOTP + * @covers \jakobo\HOTP\HOTPResult */ class HOTPTest extends TestCase { @@ -100,17 +103,7 @@ public function provideHOTP(): array ]; } - /** - * @param int $seed - * @param array $result - * - * @covers \jakobo\HOTP\HOTP::generateByCounter - * @covers \jakobo\HOTP\HOTPResult::toString - * @covers \jakobo\HOTP\HOTPResult::toHex - * @covers \jakobo\HOTP\HOTPResult::toDec - * @covers \jakobo\HOTP\HOTPResult::toHOTP - * @dataProvider provideHOTP - */ + /** @dataProvider provideHOTP */ public function testHOTP(int $seed, array $result): void { $hotp = HOTP::generateByCounter(self::KEY, $seed); @@ -147,14 +140,7 @@ public function provideTOTP(): array ]; } - /** - * @param string $seed - * @param string $result - * - * @covers \jakobo\HOTP\HOTP::generateByTime - * @covers \jakobo\HOTP\HOTPResult::toHOTP - * @dataProvider provideTOTP - */ + /** @dataProvider provideTOTP */ public function testTOTP(string $seed, string $result): void { $totp = HOTP::generateByTime(self::KEY, 30, $seed); @@ -183,13 +169,7 @@ public function provideGenerateByTimeWindow(): array ]; } - /** - * @param string $seed - * @param string[] $result - * @covers \jakobo\HOTP\HOTP::generateByTimeWindow - * @covers \jakobo\HOTP\HOTPResult::toHOTP - * @dataProvider provideGenerateByTimeWindow - */ + /** @dataProvider provideGenerateByTimeWindow */ public function testGenerateByTimeWindow(string $seed, array $result): void { $results = HOTP::generateByTimeWindow(