Skip to content
This repository was archived by the owner on Apr 19, 2025. It is now read-only.

Commit f9dfbc2

Browse files
committed
Fix styleci errors
1 parent 735044b commit f9dfbc2

13 files changed

+34
-37
lines changed

src/Contracts/SMSToken.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ interface SMSToken
1010
* @param mixed $user
1111
* @return void
1212
*/
13-
public function sendSMSToken($user) : void;
13+
public function sendSMSToken($user): void;
1414
}

src/Contracts/TwoFactorProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function enabled($user);
1818
* @param mixed $user
1919
* @return void
2020
*/
21-
public function register($user) : void;
21+
public function register($user): void;
2222

2323
/**
2424
* Unregister a user with this provider.

src/Http/Controllers/ThrottlesTwoFactorAuths.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ protected function hasTooManyTwoFactorAuthAttempts(Request $request)
2828
* @param \Illuminate\Http\Request $request
2929
* @return void
3030
*/
31-
protected function incrementTwoFactorAuthAttempts(Request $request) : void
31+
protected function incrementTwoFactorAuthAttempts(Request $request): void
3232
{
3333
self::incrementLoginAttempts($request);
3434
}
@@ -66,7 +66,7 @@ protected function sendLockoutResponse(Request $request)
6666
* @param \Illuminate\Http\Request $request
6767
* @return void
6868
*/
69-
protected function clearTwoFactorAuthAttempts(Request $request) : void
69+
protected function clearTwoFactorAuthAttempts(Request $request): void
7070
{
7171
self::clearLoginAttempts($request);
7272
}
@@ -77,7 +77,7 @@ protected function clearTwoFactorAuthAttempts(Request $request) : void
7777
* @param \Illuminate\Http\Request $request
7878
* @return string
7979
*/
80-
protected function throttleKey(Request $request) : string
80+
protected function throttleKey(Request $request): string
8181
{
8282
return Str::lower($request->session()->get('two-factor:auth')[$this->username()]).'|'.$request->ip();
8383
}

src/Http/Controllers/TwoFactorAuthenticatesUsers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ protected function sendKillTwoFactorAuthResponse(Request $request)
161161
*
162162
* @return string
163163
*/
164-
public function username() : string
164+
public function username(): string
165165
{
166166
return 'email';
167167
}

src/Providers/BaseProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function enabled($user)
1515
$enabled = config('twofactor-auth.enabled', 'user');
1616

1717
if ($enabled === 'user') {
18-
return !is_null($user->twoFactorAuth);
18+
return ! is_null($user->twoFactorAuth);
1919
}
2020

2121
return $enabled === 'always';

src/Providers/MessageBirdVerify.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct(Client $client)
3838
* @param mixed $user
3939
* @return void
4040
*/
41-
public function register($user) : void
41+
public function register($user): void
4242
{
4343
//
4444
}
@@ -107,9 +107,9 @@ public function verify($user, string $token)
107107
* @return void
108108
* @throws Exception $exception
109109
*/
110-
public function sendSMSToken($user) : void
110+
public function sendSMSToken($user): void
111111
{
112-
if (!$user->getMobile()) {
112+
if (! $user->getMobile()) {
113113
throw new Exception("No mobile phone number found for user {$user->id}.");
114114
}
115115

src/Providers/NullProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class NullProvider extends BaseProvider implements TwoFactorProvider, SMSToken
1010
/**
1111
* {@inheritdoc}
1212
*/
13-
public function register($user) : void
13+
public function register($user): void
1414
{
1515
//
1616
}
@@ -34,7 +34,7 @@ public function verify($user, string $token)
3434
/**
3535
* {@inheritdoc}
3636
*/
37-
public function sendSMSToken($user) : void
37+
public function sendSMSToken($user): void
3838
{
3939
//
4040
}

src/TwoFactorAuth.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class TwoFactorAuth extends Model
4444
*
4545
* @param \Illuminate\Database\Eloquent\Relations\BelongsTo
4646
*/
47-
public function user() : BelongsTo
47+
public function user(): BelongsTo
4848
{
4949
$model = $this->model();
5050

@@ -56,7 +56,7 @@ public function user() : BelongsTo
5656
*
5757
* @return string
5858
*/
59-
private function model() : string
59+
private function model(): string
6060
{
6161
if (is_null($this->model)) {
6262
$this->model = config('twofactor-auth.model');

src/TwoFactorAuthManager.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class TwoFactorAuthManager extends Manager
1616
* @param string $driver
1717
* @return \MichaelDzjap\TwoFactorAuth\Contracts\TwoFactorProvider
1818
*/
19-
public function provider(string $driver = null) : TwoFactorProvider
19+
public function provider(string $driver = null): TwoFactorProvider
2020
{
2121
return $this->driver($driver);
2222
}
@@ -26,7 +26,7 @@ public function provider(string $driver = null) : TwoFactorProvider
2626
*
2727
* @return \MichaelDzjap\TwoFactorAuth\Contracts\TwoFactorProvider
2828
*/
29-
protected function createMessageBirdDriver() : TwoFactorProvider
29+
protected function createMessageBirdDriver(): TwoFactorProvider
3030
{
3131
return new MessageBirdVerify(
3232
new Client($this->app['config']['twofactor-auth.providers.messagebird.key'])
@@ -38,7 +38,7 @@ protected function createMessageBirdDriver() : TwoFactorProvider
3838
*
3939
* @return \MichaelDzjap\TwoFactorAuth\Contracts\TwoFactorProvider
4040
*/
41-
protected function createNullDriver() : TwoFactorProvider
41+
protected function createNullDriver(): TwoFactorProvider
4242
{
4343
return new NullProvider;
4444
}
@@ -48,7 +48,7 @@ protected function createNullDriver() : TwoFactorProvider
4848
*
4949
* @return string
5050
*/
51-
public function getDefaultDriver() : string
51+
public function getDefaultDriver(): string
5252
{
5353
return $this->app['config']['twofactor-auth.default'];
5454
}
@@ -59,7 +59,7 @@ public function getDefaultDriver() : string
5959
* @param string $name
6060
* @return void
6161
*/
62-
public function setDefaultDriver(string $name) : void
62+
public function setDefaultDriver(string $name): void
6363
{
6464
$this->app['config']['twofactor-auth.default'] = $name;
6565
}

src/TwoFactorAuthServiceProvider.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class TwoFactorAuthServiceProvider extends ServiceProvider
1313
*
1414
* @return void
1515
*/
16-
public function boot() : void
16+
public function boot(): void
1717
{
1818
$this->loadRoutesFrom(__DIR__.'/routes.php');
1919

@@ -39,7 +39,7 @@ public function boot() : void
3939
*
4040
* @return void
4141
*/
42-
public function register() : void
42+
public function register(): void
4343
{
4444
$this->mergeConfigFrom(
4545
__DIR__.'/config/twofactor-auth.php', 'twofactor-auth'
@@ -55,11 +55,11 @@ public function register() : void
5555
}
5656

5757
/**
58-
* Publish this package's migration files
58+
* Publish this package's migration files.
5959
*
6060
* @return void
6161
*/
62-
protected function publishMigrations() : void
62+
protected function publishMigrations(): void
6363
{
6464
$files = [
6565
'add_mobile_to_users_table.php',
@@ -69,10 +69,9 @@ protected function publishMigrations() : void
6969
$paths = [];
7070

7171
foreach ($files as $file) {
72-
$paths[__DIR__.'/database/migrations/'. $file] = database_path('migrations/'.date('Y_m_d_His').'_'.$file);
72+
$paths[__DIR__.'/database/migrations/'.$file] = database_path('migrations/'.date('Y_m_d_His').'_'.$file);
7373
}
7474

7575
$this->publishes($paths, 'migrations');
7676
}
77-
7877
}

0 commit comments

Comments
 (0)