Skip to content

Commit

Permalink
Merge branch '8.x' of github.com:antonioribeiro/google2fa into 8.x
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioribeiro committed Apr 5, 2020
2 parents 1a28a75 + 91d161a commit e7b29fe
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ist: xenial
dist: xenial

language: php

Expand Down
15 changes: 8 additions & 7 deletions src/Google2FA.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace PragmaRX\Google2FA;

use PragmaRX\Google2FA\Support\QRCode;
use PragmaRX\Google2FA\Support\Base32;
use PragmaRX\Google2FA\Support\Constants;
use PragmaRX\Google2FA\Exceptions\InvalidAlgorithmException;
use PragmaRX\Google2FA\Exceptions\SecretKeyTooShortException;
use PragmaRX\Google2FA\Support\Base32;
use PragmaRX\Google2FA\Support\Constants;
use PragmaRX\Google2FA\Support\QRCode;

class Google2FA
{
Expand Down Expand Up @@ -109,14 +109,14 @@ protected function generateHotp($secret, $counter)
/**
* Generate a digit secret key in base32 format.
*
* @param int $length
* @param int $length
* @param string $prefix
*
* @return string
*
* @throws \PragmaRX\Google2FA\Exceptions\IncompatibleWithGoogleAuthenticatorException
* @throws \PragmaRX\Google2FA\Exceptions\InvalidCharactersException
* @throws \PragmaRX\Google2FA\Exceptions\SecretKeyTooShortException
*
* @return string
*/
public function generateSecretKey($length = 16, $prefix = '')
{
Expand Down Expand Up @@ -336,8 +336,9 @@ public function setEnforceGoogleAuthenticatorCompatibility(
*
* @param mixed $algorithm
*
* @return \PragmaRX\Google2FA\Google2FA
* @throws \PragmaRX\Google2FA\Exceptions\InvalidAlgorithmException
*
* @return \PragmaRX\Google2FA\Google2FA
*/
public function setAlgorithm($algorithm)
{
Expand Down
16 changes: 8 additions & 8 deletions src/Support/Base32.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
namespace PragmaRX\Google2FA\Support;

use ParagonIE\ConstantTime\Base32 as ParagonieBase32;
use PragmaRX\Google2FA\Exceptions\IncompatibleWithGoogleAuthenticatorException;
use PragmaRX\Google2FA\Exceptions\InvalidCharactersException;
use PragmaRX\Google2FA\Exceptions\SecretKeyTooShortException;
use PragmaRX\Google2FA\Exceptions\IncompatibleWithGoogleAuthenticatorException;

trait Base32
{
Expand All @@ -29,15 +29,15 @@ protected function charCountBits($b32)
/**
* Generate a digit secret key in base32 format.
*
* @param int $length
* @param int $length
* @param string $prefix
*
* @return string
*
* @throws \Exception
* @throws \PragmaRX\Google2FA\Exceptions\InvalidCharactersException
* @throws \PragmaRX\Google2FA\Exceptions\SecretKeyTooShortException
* @throws \PragmaRX\Google2FA\Exceptions\IncompatibleWithGoogleAuthenticatorException
*
* @return string
*/
public function generateBase32RandomKey($length = 16, $prefix = '')
{
Expand All @@ -55,11 +55,11 @@ public function generateBase32RandomKey($length = 16, $prefix = '')
*
* @param string $b32
*
* @return string
*
* @throws \PragmaRX\Google2FA\Exceptions\InvalidCharactersException
* @throws \PragmaRX\Google2FA\Exceptions\SecretKeyTooShortException
* @throws \PragmaRX\Google2FA\Exceptions\IncompatibleWithGoogleAuthenticatorException
*
* @return string
*/
public function base32Decode($b32)
{
Expand Down Expand Up @@ -125,9 +125,9 @@ public function toBase32($string)
* @param int $from
* @param int $to
*
* @return int
*
* @throws \Exception
*
* @return int
*/
protected function getRandomNumber($from = 0, $to = 31)
{
Expand Down
1 change: 0 additions & 1 deletion tests/QRCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use PHPUnit\Framework\TestCase;
use PragmaRX\Google2FA\Google2FA;
use PragmaRX\Google2FA\Support\Constants as Google2FAConstants;

class QRCodeTest extends TestCase
{
Expand Down

0 comments on commit e7b29fe

Please sign in to comment.