Fix phpstan

This commit is contained in:
slawkens
2026-04-24 20:36:56 +02:00
parent ac9a328206
commit 54bdea85a3
3 changed files with 8 additions and 3 deletions

View File

@@ -31,8 +31,6 @@ parameters:
- '#Call to an undefined method [a-zA-Z0-9\\_]+::[a-zA-Z0-9\\_]+\(\)#' - '#Call to an undefined method [a-zA-Z0-9\\_]+::[a-zA-Z0-9\\_]+\(\)#'
- '#Call to an undefined static method [a-zA-Z0-9\\_]+::[a-zA-Z0-9\\_]+\(\)#' - '#Call to an undefined static method [a-zA-Z0-9\\_]+::[a-zA-Z0-9\\_]+\(\)#'
# system/pages/highscores.php # system/pages/highscores.php
- '#Access to an undefined property Illuminate\\Database\\Eloquent\\Model::\$online_status#'
- '#Access to an undefined property Illuminate\\Database\\Eloquent\\Model::\$vocation_name#'
- -
message: '#Variable \$tmp in empty\(\) always exists and is always falsy#' message: '#Variable \$tmp in empty\(\) always exists and is always falsy#'
path: templates\kathrine\javascript.php path: templates\kathrine\javascript.php

View File

@@ -210,10 +210,13 @@ if (empty($highscores)) {
} }
$highscores = $query->get()->map(function($row) { $highscores = $query->get()->map(function($row) {
/**
* @var Player $row
*/
$tmp = $row->toArray(); $tmp = $row->toArray();
$tmp['online'] = $row->online_status; $tmp['online'] = $row->online_status;
$tmp['vocation'] = $row->vocation_name; $tmp['vocation'] = $row->vocation_name;
$tmp['outfit_url'] = $row->outfit_url; // @phpstan-ignore-line $tmp['outfit_url'] = $row->outfit_url;
$tmp['link'] = getPlayerLink($row->name, false); $tmp['link'] = getPlayerLink($row->name, false);
unset($tmp['online_table']); unset($tmp['online_table']);

View File

@@ -5,6 +5,7 @@ use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasOne; use Illuminate\Database\Eloquent\Relations\HasOne;
/** /**
* @property string $name
* @property int $level * @property int $level
* @property int $vocation * @property int $vocation
* @property int $online * @property int $online
@@ -14,6 +15,9 @@ use Illuminate\Database\Eloquent\Relations\HasOne;
* @property int $looklegs * @property int $looklegs
* @property int $lookfeet * @property int $lookfeet
* @property int $lookaddons * @property int $lookaddons
* @property int $promotion
* @property bool $online_status
* @property string $vocation_name
* @property string $outfit_url * @property string $outfit_url
* @property hasOne $onlineTable * @property hasOne $onlineTable
*/ */