diff --git a/phpstan.neon b/phpstan.neon index b77bc1d2..fda6a07c 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -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#' diff --git a/system/pages/monsters.php b/system/pages/monsters.php index f8a8a66a..e254fb6f 100644 --- a/system/pages/monsters.php +++ b/system/pages/monsters.php @@ -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']) {