Skip to content

Commit 83c8072

Browse files
committed
Apply fixes from StyleCI
1 parent c5c001a commit 83c8072

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

extend.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,13 @@
1717
use Flarum\Api\Serializer\CurrentUserSerializer;
1818
use Flarum\Api\Serializer\ForumSerializer;
1919
use Flarum\Api\Serializer\GroupSerializer;
20-
use Flarum\Console\Schedule;
2120
use Flarum\Extend;
2221
use Flarum\Group\Event\Saving as GroupSaving;
2322
use Flarum\Group\Group;
2423
use Flarum\User\User;
2524
use IanM\TwoFactor\Api\Serializer\TwoFactorSerializer;
2625
use IanM\TwoFactor\Model\TwoFactor;
2726
use IanM\TwoFactor\OAuth\TwoFactorOAuthCheck;
28-
use Illuminate\Console\Scheduling\Event;
2927

3028
return [
3129
(new Extend\Frontend('forum'))
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of ianm/twofactor.
5+
*
6+
* Copyright (c) 2023 IanM.
7+
*
8+
* For the full copyright and license information, please view the LICENSE.md
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace IanM\TwoFactor\Console;
413

514
use Flarum\Settings\SettingsRepositoryInterface;
@@ -9,14 +18,15 @@ class InactiveTokensSchedule
918
{
1019
public function __construct(
1120
protected SettingsRepositoryInterface $settings
12-
) { }
21+
) {
22+
}
1323

1424
public function __invoke(Event $event)
1525
{
1626
if (! (bool) $this->settings->get('ianm-twofactor.kill_inactive_tokens')) {
1727
return;
1828
}
19-
29+
2030
$event->twiceDaily();
2131
}
2232
}

src/Console/KillInactiveTokensCommand.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of ianm/twofactor.
5+
*
6+
* Copyright (c) 2023 IanM.
7+
*
8+
* For the full copyright and license information, please view the LICENSE.md
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace IanM\TwoFactor\Console;
413

514
use Carbon\Carbon;
@@ -22,7 +31,7 @@ public function handle(): void
2231
{
2332
$age = (int) $this->settings->get('ianm-twofactor.kill_inactive_tokens_age_days');
2433
$maxAge = Carbon::now()->subdays($age);
25-
34+
2635
$query = AccessToken::query()
2736
->where('last_activity_at', '<', $maxAge);
2837

@@ -35,6 +44,7 @@ public function handle(): void
3544

3645
if ($count === 0) {
3746
$this->info("No tokens found which have not been used in $age+ days.");
47+
3848
return;
3949
}
4050

0 commit comments

Comments
 (0)