Fix PHPStan errors in monsters.php

This commit is contained in:
slawkens 2024-07-12 20:48:27 +02:00
parent da14e125e9
commit 28f98db9de
2 changed files with 3 additions and 0 deletions

View File

@ -29,6 +29,7 @@ parameters:
- '#Variable \$[a-zA-Z0-9\\_]+ might not be defined#'
# Eloquent models
- '#Call to an undefined static method [a-zA-Z0-9\\_]+::[a-zA-Z0-9\\_]+()#'
- '#Call to an undefined method object::toArray\(\)#'
# system/pages/highscores.php
- '#Call to an undefined method Illuminate\\Database\\Query\\Builder::withOnlineStatus\(\)#'
- '#Access to an undefined property Illuminate\\Database\\Eloquent\\Model::\$online_status#'

View File

@ -44,6 +44,8 @@ $monster = Monster::where('hide', '!=', 1)->where('name', $monster_name)->first(
if ($monster && isset($monster->name)) {
$monster = $monster->toArray();
/** @var array $monster */
function sort_by_chance($a, $b)
{
if ($a['chance'] == $b['chance']) {