Merge pull request #32279 from frederic34/fix_phpstan_20241208
fix phpstan
This commit is contained in:
commit
5dbe5e6fe4
7 changed files with 23 additions and 44 deletions
|
|
@ -28812,36 +28812,6 @@ parameters:
|
|||
count: 1
|
||||
path: ../../htdocs/public/members/public_list.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$conf might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 3
|
||||
path: ../../htdocs/public/members/public_list.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$db might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 12
|
||||
path: ../../htdocs/public/members/public_list.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$langs might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 6
|
||||
path: ../../htdocs/public/members/public_list.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$db might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 1
|
||||
path: ../../htdocs/public/notice.php
|
||||
|
||||
-
|
||||
message: '#^Variable \$langs might not be defined\.$#'
|
||||
identifier: variable.undefined
|
||||
count: 2
|
||||
path: ../../htdocs/public/notice.php
|
||||
|
||||
-
|
||||
message: '#^Call to function is_numeric\(\) with int will always evaluate to true\.$#'
|
||||
identifier: function.alreadyNarrowedType
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2014 Maxime Kohlhaas <support@atm-consulting.fr>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
/* Copyright (C) 2014 Maxime Kohlhaas <support@atm-consulting.fr>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2014 Maxime Kohlhaas <support@atm-consulting.fr>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
/* Copyright (C) 2014 Maxime Kohlhaas <support@atm-consulting.fr>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
|
|||
|
|
@ -55,9 +55,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)) { // $entity is casted to int
|
||||
define("DOLENTITY", $entity);
|
||||
// }
|
||||
|
||||
|
||||
// Load Dolibarr environment
|
||||
|
|
|
|||
|
|
@ -43,9 +43,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)) { // $entity is casted to int
|
||||
define("DOLENTITY", $entity);
|
||||
// }
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
|
|
|
|||
|
|
@ -42,12 +42,17 @@ 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)) { // $entity is casted to int
|
||||
define("DOLENTITY", $entity);
|
||||
// }
|
||||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
/**
|
||||
* @var Conf $conf
|
||||
* @var DoliDB $db
|
||||
* @var Translate $langs
|
||||
*/
|
||||
|
||||
// Security check
|
||||
if (!isModEnabled('member')) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2016-2021 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -41,7 +42,10 @@ if (!defined('NOBROWSERNOTIF')) {
|
|||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
|
||||
/**
|
||||
* @var DoliDB $db
|
||||
* @var Translate $langs
|
||||
*/
|
||||
|
||||
/**
|
||||
* View
|
||||
|
|
|
|||
Loading…
Reference in a new issue