@@ -85,9 +85,9 @@ discard block |
||
| 85 | 85 | /** |
| 86 | 86 | * Get a config value. |
| 87 | 87 | * |
| 88 | - * @param $string |
|
| 88 | + * @param string $string |
|
| 89 | 89 | * @param array $children |
| 90 | - * @return mixed |
|
| 90 | + * @return string|null |
|
| 91 | 91 | * @throws \Exception |
| 92 | 92 | */ |
| 93 | 93 | protected function config($string, $children = []) |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | * Make a session var name for. |
| 224 | 224 | * |
| 225 | 225 | * @param null $name |
| 226 | - * @return mixed |
|
| 226 | + * @return string |
|
| 227 | 227 | */ |
| 228 | 228 | protected function makeSessionVarName($name = null) |
| 229 | 229 | { |
@@ -243,8 +243,8 @@ discard block |
||
| 243 | 243 | /** |
| 244 | 244 | * Make a JSON response. |
| 245 | 245 | * |
| 246 | - * @param $statusCode |
|
| 247 | - * @return JsonResponse |
|
| 246 | + * @param integer $statusCode |
|
| 247 | + * @return IlluminateJsonResponse |
|
| 248 | 248 | */ |
| 249 | 249 | protected function makeJsonResponse($statusCode) |
| 250 | 250 | { |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | /** |
| 272 | 272 | * Make a web response. |
| 273 | 273 | * |
| 274 | - * @param $statusCode |
|
| 274 | + * @param integer $statusCode |
|
| 275 | 275 | * @return \Illuminate\Http\Response |
| 276 | 276 | */ |
| 277 | 277 | protected function makeHtmlResponse($statusCode) |
@@ -321,8 +321,8 @@ discard block |
||
| 321 | 321 | /** |
| 322 | 322 | * Get a session var value. |
| 323 | 323 | * |
| 324 | - * @param null $var |
|
| 325 | - * @return mixed |
|
| 324 | + * @param string $var |
|
| 325 | + * @return null|Carbon |
|
| 326 | 326 | */ |
| 327 | 327 | public function sessionGet($var = null) |
| 328 | 328 | { |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | /** |
| 335 | 335 | * Put a var value to the current session. |
| 336 | 336 | * |
| 337 | - * @param $var |
|
| 337 | + * @param string $var |
|
| 338 | 338 | * @param $value |
| 339 | 339 | * @return mixed |
| 340 | 340 | */ |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | protected function canPassWithoutCheckingOTP() |
| 77 | 77 | { |
| 78 | 78 | return |
| 79 | - ! $this->isEnabled() || |
|
| 79 | + !$this->isEnabled() || |
|
| 80 | 80 | $this->noUserIsAuthenticated() || |
| 81 | 81 | $this->twoFactorAuthStillValid() |
| 82 | 82 | ; |
@@ -90,14 +90,14 @@ discard block |
||
| 90 | 90 | * @return mixed |
| 91 | 91 | * @throws \Exception |
| 92 | 92 | */ |
| 93 | - protected function config($string, $children = []) |
|
| 93 | + protected function config($string, $children = [ ]) |
|
| 94 | 94 | { |
| 95 | 95 | if (is_null(config(static::CONFIG_PACKAGE_NAME))) { |
| 96 | 96 | throw new \Exception('Config not found'); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | return config( |
| 100 | - implode('.', array_merge([static::CONFIG_PACKAGE_NAME, $string], (array) $children)) |
|
| 100 | + implode('.', array_merge([ static::CONFIG_PACKAGE_NAME, $string ], (array) $children)) |
|
| 101 | 101 | ); |
| 102 | 102 | } |
| 103 | 103 | |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | */ |
| 187 | 187 | protected function getOneTimePassword() |
| 188 | 188 | { |
| 189 | - if (! is_null($this->password)) { |
|
| 189 | + if (!is_null($this->password)) { |
|
| 190 | 190 | return $this->password; |
| 191 | 191 | } |
| 192 | 192 | |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | */ |
| 228 | 228 | protected function makeSessionVarName($name = null) |
| 229 | 229 | { |
| 230 | - return $this->config('session_var') . (is_null($name) || empty($name)? '' : '.' . $name); |
|
| 230 | + return $this->config('session_var').(is_null($name) || empty($name) ? '' : '.'.$name); |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | /** |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | protected function makeStatusCode() |
| 263 | 263 | { |
| 264 | 264 | return |
| 265 | - $this->inputHasOneTimePassword() && ! $this->checkOTP() |
|
| 265 | + $this->inputHasOneTimePassword() && !$this->checkOTP() |
|
| 266 | 266 | ? SymfonyResponse::HTTP_UNPROCESSABLE_ENTITY |
| 267 | 267 | : SymfonyResponse::HTTP_OK |
| 268 | 268 | ; |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | { |
| 404 | 404 | return |
| 405 | 405 | (bool) $this->sessionGet(self::SESSION_AUTH_PASSED, false) && |
| 406 | - ! $this->passwordExpired() |
|
| 406 | + !$this->passwordExpired() |
|
| 407 | 407 | ; |
| 408 | 408 | } |
| 409 | 409 | |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | */ |
| 449 | 449 | protected function checkOTP() |
| 450 | 450 | { |
| 451 | - if (! $this->inputHasOneTimePassword()) { |
|
| 451 | + if (!$this->inputHasOneTimePassword()) { |
|
| 452 | 452 | return false; |
| 453 | 453 | } |
| 454 | 454 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | public function provides() |
| 43 | 43 | { |
| 44 | - return ['pragmarx.google2fa']; |
|
| 44 | + return [ 'pragmarx.google2fa' ]; |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | public function register() |
| 53 | 53 | { |
| 54 | - $this->app->singleton('pragmarx.google2fa', function ($app) { |
|
| 54 | + $this->app->singleton('pragmarx.google2fa', function($app) { |
|
| 55 | 55 | return $app->make(Google2FA::class); |
| 56 | 56 | }); |
| 57 | 57 | |