Skip to content

Commit 9555b45

Browse files
authored
Merge pull request #130 from kenjis/refactor-record-active
refactor: change recordActive() to recordActiveDate()
2 parents 020b48f + 0bbc231 commit 9555b45

File tree

6 files changed

+12
-8
lines changed

6 files changed

+12
-8
lines changed

src/Auth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* @method bool login(User $user)
2020
* @method void loginById($userId)
2121
* @method bool logout()
22-
* @method void recordActive()
22+
* @method void recordActiveDate()
2323
*
2424
* Authenticators\Session:
2525
* @method $this remember(bool $shouldRemember = true)

src/Authentication/AuthenticatorInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,5 @@ public function getUser(): ?User;
6060
/**
6161
* Updates the user's last active date.
6262
*/
63-
public function recordActive(): void;
63+
public function recordActiveDate(): void;
6464
}

src/Authentication/Authenticators/AccessTokens.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,12 @@ public function getBearerToken(): ?string
216216
/**
217217
* Updates the user's last active date.
218218
*/
219-
public function recordActive(): void
219+
public function recordActiveDate(): void
220220
{
221221
if (! $this->user instanceof User) {
222-
throw new InvalidArgumentException(self::class . '::recordActive() requires logged in user before calling.');
222+
throw new InvalidArgumentException(
223+
self::class . '::recordActiveDate() requires logged in user before calling.'
224+
);
223225
}
224226

225227
$this->user->last_active = Time::now();

src/Authentication/Authenticators/Session.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,10 +369,12 @@ public function getUser(): ?User
369369
/**
370370
* Updates the user's last active date.
371371
*/
372-
public function recordActive(): void
372+
public function recordActiveDate(): void
373373
{
374374
if (! $this->user instanceof User) {
375-
throw new InvalidArgumentException(self::class . '::recordActive() requires logged in user before calling.');
375+
throw new InvalidArgumentException(
376+
self::class . '::recordActiveDate() requires logged in user before calling.'
377+
);
376378
}
377379

378380
$this->user->last_active = Time::now();

src/Filters/SessionAuth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function before(RequestInterface $request, $arguments = null)
4040
}
4141

4242
if (setting('Auth.recordActiveDate')) {
43-
auth('session')->recordActive();
43+
auth('session')->recordActiveDate();
4444
}
4545

4646
/** @var UserIdentityModel $identityModel */

src/Filters/TokenAuth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function before(RequestInterface $request, $arguments = null)
4242
}
4343

4444
if (setting('Auth.recordActiveDate')) {
45-
auth('tokens')->recordActive();
45+
auth('tokens')->recordActiveDate();
4646
}
4747
}
4848

0 commit comments

Comments
 (0)