1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-21 21:30:08 +00:00

Add proper return types to PageHandlers

This commit is contained in:
Tim Düsterhus 2022-03-04 19:20:58 +01:00
parent 54a84be9a6
commit 9119b4ab22
Signed by: TimWolla
GPG Key ID: 8FF75566094168AF
4 changed files with 10 additions and 10 deletions

View File

@ -35,7 +35,7 @@ final class LogPageHandler extends AbstractLookupPageHandler implements IOnlineL
/**
* @inheritDoc
*/
public function getLink($objectID)
public function getLink($objectID): string
{
$room = RoomCache::getInstance()->getRoom($objectID);
if ($room === null) {
@ -54,7 +54,7 @@ public function getLink($objectID)
/**
* @inheritDoc
*/
public function isVisible($objectID = null)
public function isVisible($objectID = null): bool
{
if (!WCF::getUser()->userID) {
return false;
@ -74,7 +74,7 @@ public function isVisible($objectID = null)
/**
* @inheritDoc
*/
public function getOnlineLocation(Page $page, UserOnline $user)
public function getOnlineLocation(Page $page, UserOnline $user): string
{
if ($user->pageObjectID === null) {
return '';

View File

@ -27,7 +27,7 @@ final class RoomListPageHandler extends AbstractMenuPageHandler
/**
* @inheritDoc
*/
public function getOutstandingItemCount($objectID = null)
public function getOutstandingItemCount($objectID = null): int
{
$rooms = RoomCache::getInstance()->getRooms();
$users = \array_map(static function (Room $room) {
@ -46,7 +46,7 @@ public function getOutstandingItemCount($objectID = null)
/**
* @inheritDoc
*/
public function isVisible($objectID = null)
public function isVisible($objectID = null): bool
{
return Room::canSeeAny();
}

View File

@ -34,7 +34,7 @@ final class RoomPageHandler extends AbstractLookupPageHandler implements IOnline
/**
* @inheritDoc
*/
public function getOutstandingItemCount($objectID = null)
public function getOutstandingItemCount($objectID = null): int
{
return \count(RoomCache::getInstance()->getRoom($objectID)->getUsers());
}
@ -42,7 +42,7 @@ public function getOutstandingItemCount($objectID = null)
/**
* @inheritDoc
*/
public function getLink($objectID)
public function getLink($objectID): string
{
$room = RoomCache::getInstance()->getRoom($objectID);
if ($room === null) {
@ -55,7 +55,7 @@ public function getLink($objectID)
/**
* @inheritDoc
*/
public function isVisible($objectID = null)
public function isVisible($objectID = null): bool
{
if (!WCF::getUser()->userID) {
return false;
@ -76,7 +76,7 @@ public function isVisible($objectID = null)
/**
* @inheritDoc
*/
public function getOnlineLocation(Page $page, UserOnline $user)
public function getOnlineLocation(Page $page, UserOnline $user): string
{
if ($user->pageObjectID === null) {
return '';

View File

@ -27,7 +27,7 @@ trait TRoomPageHandler
/**
* @inheritDoc
*/
public function isValid($objectID)
public function isValid($objectID): bool
{
$room = RoomCache::getInstance()->getRoom($objectID);