diff options
author | Antonio Carlos Ribeiro <acr@antoniocarlosribeiro.com> | 2017-06-19 23:11:00 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-19 23:11:00 -0300 |
commit | 7fc03d8579d86ad38a2bedd2d633ea2e87bca0dc (patch) | |
tree | 1fd6c902811ebff2d1835f8e944389f35aa72c96 | |
parent | 01bb745d88f25676519ca2911144867f9fe89a88 (diff) | |
parent | 8192aaf8aa47b3c20e61f070c429d76990cfdc3a (diff) | |
download | google2fa-7fc03d8579d86ad38a2bedd2d633ea2e87bca0dc.zip google2fa-7fc03d8579d86ad38a2bedd2d633ea2e87bca0dc.tar.gz google2fa-7fc03d8579d86ad38a2bedd2d633ea2e87bca0dc.tar.bz2 |
Merge pull request #63 from antonioribeiro/analysis-86x5vl
Apply fixes from StyleCI
[ci skip] [skip ci]
-rw-r--r-- | src/Google2FA.php | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/Google2FA.php b/src/Google2FA.php index b90e556..1712c19 100644 --- a/src/Google2FA.php +++ b/src/Google2FA.php @@ -30,13 +30,13 @@ namespace PragmaRX\Google2FA; * @author Antonio Carlos Ribeiro @ PragmaRX **/ +use BaconQrCode\Renderer\Image\Png; use BaconQrCode\Writer; use ParagonIE\ConstantTime\Base32; -use PragmaRX\Google2FA\Support\Url; -use BaconQrCode\Renderer\Image\Png; +use PragmaRX\Google2FA\Exceptions\IncompatibleWithGoogleAuthenticatorException; use PragmaRX\Google2FA\Exceptions\InvalidCharactersException; use PragmaRX\Google2FA\Exceptions\SecretKeyTooShortException; -use PragmaRX\Google2FA\Exceptions\IncompatibleWithGoogleAuthenticatorException; +use PragmaRX\Google2FA\Support\Url; class Google2FA { @@ -61,12 +61,12 @@ class Google2FA protected $enforceGoogleAuthenticatorCompatibility = true; /** - * Secret + * Secret. */ protected $secret; /** - * Window + * Window. */ protected $window = 1; // Keys will be valid for 60 seconds @@ -150,8 +150,7 @@ class Google2FA return is_null($secret) ? $this->secret - : $secret - ; + : $secret; } /** @@ -193,14 +192,14 @@ class Google2FA return is_null($window) ? $this->window - : $window - ; + : $window; } /** * Get/use a starting timestamp for key verification. * * @param string|int|null $timestamp + * * @return int */ protected function makeStartingTimestamp($timestamp = null) @@ -314,11 +313,12 @@ class Google2FA * Verifies a user inputted key against the current timestamp. Checks $window * keys either side of the timestamp. * - * @param string $key - User specified key - * @param null|string $secret - * @param null|int $window - * @param bool|int $timestamp - * @param null|int $oldTimestamp + * @param string $key - User specified key + * @param null|string $secret + * @param null|int $window + * @param bool|int $timestamp + * @param null|int $oldTimestamp + * * @return bool|int */ public function verify($key, $secret = null, $window = null, $timestamp = null, $oldTimestamp = null) @@ -337,10 +337,11 @@ class Google2FA * keys either side of the timestamp. * * @param string $secret - * @param string $key - User specified key + * @param string $key - User specified key * @param null|int $window * @param bool|int $timestamp * @param null|int $oldTimestamp + * * @return bool|int */ public function verifyKey($secret, $key, $window = null, $timestamp = null, $oldTimestamp = null) @@ -358,8 +359,7 @@ class Google2FA return is_null($oldTimestamp) ? true - : $ts - ; + : $ts; } } |