Skip to content

Commit 9d9e0c9

Browse files
committed
fix: getBadgeValue return type
1 parent 98e8bef commit 9d9e0c9

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/Collectors/Auth.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,14 @@ public function display(): string
8282
/**
8383
* Gets the "badge" value for the button.
8484
*
85-
* @return int|null ID of the current User, or null when not logged in
85+
* @return int|string|null ID of the current User, or null when not logged in
8686
*/
87-
public function getBadgeValue(): ?int
87+
public function getBadgeValue()
8888
{
89-
return service('auth')->loggedIn() ? service('auth')->id() : null;
89+
/** @var \CodeIgniter\Shield\Auth $auth */
90+
$auth = service('auth');
91+
92+
return $auth->loggedIn() ? $auth->id() : null;
9093
}
9194

9295
/**

0 commit comments

Comments
 (0)