summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntonio Carlos Ribeiro <acr@antoniocarlosribeiro.com>2017-06-20 02:10:54 +0000
committerStyleCI Bot <bot@styleci.io>2017-06-20 02:10:54 +0000
commit8192aaf8aa47b3c20e61f070c429d76990cfdc3a (patch)
tree1fd6c902811ebff2d1835f8e944389f35aa72c96
parent01bb745d88f25676519ca2911144867f9fe89a88 (diff)
downloadgoogle2fa-8192aaf8aa47b3c20e61f070c429d76990cfdc3a.zip
google2fa-8192aaf8aa47b3c20e61f070c429d76990cfdc3a.tar.gz
google2fa-8192aaf8aa47b3c20e61f070c429d76990cfdc3a.tar.bz2
Apply fixes from StyleCI
[ci skip] [skip ci]
-rw-r--r--src/Google2FA.php34
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;
}
}