mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-21 21:30:08 +00:00
Add proper types to TNeedsUser
This commit is contained in:
parent
c5485440bf
commit
b8a76b412f
@ -26,11 +26,8 @@ trait TNeedsUser
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Returns the user with the given username.
|
* Returns the user with the given username.
|
||||||
*
|
|
||||||
* @param string $username
|
|
||||||
* @return \wcf\data\user\User
|
|
||||||
*/
|
*/
|
||||||
protected function getUser($username)
|
protected function getUser(string $username): User
|
||||||
{
|
{
|
||||||
static $cache = [ ];
|
static $cache = [ ];
|
||||||
if (!isset($cache[$username])) {
|
if (!isset($cache[$username])) {
|
||||||
@ -42,11 +39,8 @@ protected function getUser($username)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether the given username is valid and throws otherwise.
|
* Checks whether the given username is valid and throws otherwise.
|
||||||
*
|
|
||||||
* @param string $username
|
|
||||||
* @return \wcf\data\user\User
|
|
||||||
*/
|
*/
|
||||||
protected function assertUser($username)
|
protected function assertUser(string $username): User
|
||||||
{
|
{
|
||||||
$user = $this->getUser($username);
|
$user = $this->getUser($username);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user