From c1b213b39f5e6de7ef671d6440bc0d5bf40d7d2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Sat, 7 Dec 2024 14:21:23 +0100 Subject: [PATCH] fix phpstan --- build/phpstan/phpstan-baseline.neon | 6 ------ htdocs/public/company/new.php | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/build/phpstan/phpstan-baseline.neon b/build/phpstan/phpstan-baseline.neon index f66b38c48be..9b4bcbd707b 100644 --- a/build/phpstan/phpstan-baseline.neon +++ b/build/phpstan/phpstan-baseline.neon @@ -28506,12 +28506,6 @@ parameters: count: 1 path: ../../htdocs/public/clicktodial/cidlookup.php - - - message: '#^Call to function is_numeric\(\) with int will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../htdocs/public/company/new.php - - message: '#^Call to function is_numeric\(\) with int will always evaluate to true\.$#' identifier: function.alreadyNarrowedType diff --git a/htdocs/public/company/new.php b/htdocs/public/company/new.php index f750ac88cea..f7942e267c5 100644 --- a/htdocs/public/company/new.php +++ b/htdocs/public/company/new.php @@ -46,9 +46,9 @@ if (!defined('NOBROWSERNOTIF')) { // Do not use GETPOST here, function is not defined and define must be done before including main.inc.php // Because 2 entities can have the same ref $entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1)); -if (is_numeric($entity)) { - define("DOLENTITY", $entity); -} +// if (is_numeric($entity)) { // value is casted to int so always numeric +define("DOLENTITY", $entity); +// } // Load Dolibarr environment