From d8ec14bc46b7e6e451ed90c6dfcf6b326d0b2c58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 1 Sep 2025 22:26:41 +0200 Subject: [PATCH] clean code (#35167) * clean code * clean code --- dev/build/phpstan/phpstan-baseline.neon | 6 ------ htdocs/comm/action/class/cactioncomm.class.php | 11 ++++++----- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index c2b933df08b..7da5d40851c 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -2772,12 +2772,6 @@ parameters: count: 2 path: ../../../htdocs/comm/action/class/cactioncomm.class.php - - - message: '#^Variable \$TSystem might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/comm/action/class/cactioncomm.class.php - - message: '#^Call to function is_array\(\) with array\ will always evaluate to true\.$#' identifier: function.alreadyNarrowedType diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index 19b0fdf74e3..4a5689452a7 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2002-2003 Rodolphe Quiedeville * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2024-2025 MDW + * Copyright (C) 2025 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -189,13 +190,13 @@ class CActionComm $resql = $this->db->query($sql); if ($resql) { $nump = $this->db->num_rows($resql); + $TSystem = array( + 'id' => [], + 'code' => [], + 'all' => [] + ); if ($nump) { $idforallfornewmodule = 96; - $TSystem = array( - 'id' => [], - 'code' => [], - 'all' => [] - ); $TSystemAuto = array( 'id' => [], 'code' => [],