Skip to content

Commit 6456782

Browse files
committed
Merge branch 'develop' of [email protected]:Dolibarr/dolibarr.git into new_dev_add_constant_thirdparty_member
2 parents 7b9360b + 20a428e commit 6456782

File tree

63 files changed

+699
-571
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+699
-571
lines changed

dev/build/phpstan/phpstan-baseline.neon

Lines changed: 0 additions & 186 deletions
Original file line numberDiff line numberDiff line change
@@ -444,12 +444,6 @@ parameters:
444444
count: 2
445445
path: ../../../htdocs/adherents/type.php
446446

447-
-
448-
message: '#^Negated boolean expression is always true\.$#'
449-
identifier: booleanNot.alwaysTrue
450-
count: 1
451-
path: ../../../htdocs/admin/accountant.php
452-
453447
-
454448
message: '#^Ternary operator condition is always true\.$#'
455449
identifier: ternary.alwaysTrue
@@ -552,12 +546,6 @@ parameters:
552546
count: 1
553547
path: ../../../htdocs/admin/fediverse.php
554548

555-
-
556-
message: '#^Negated boolean expression is always true\.$#'
557-
identifier: booleanNot.alwaysTrue
558-
count: 1
559-
path: ../../../htdocs/admin/geoipmaxmind.php
560-
561549
-
562550
message: '#^If condition is always true\.$#'
563551
identifier: if.alwaysTrue
@@ -768,12 +756,6 @@ parameters:
768756
count: 2
769757
path: ../../../htdocs/admin/mails_ticket.php
770758

771-
-
772-
message: '#^Negated boolean expression is always true\.$#'
773-
identifier: booleanNot.alwaysTrue
774-
count: 2
775-
path: ../../../htdocs/admin/menus/edit.php
776-
777759
-
778760
message: '#^If condition is always true\.$#'
779761
identifier: if.alwaysTrue
@@ -816,18 +798,6 @@ parameters:
816798
count: 2
817799
path: ../../../htdocs/admin/notification.php
818800

819-
-
820-
message: '#^Negated boolean expression is always true\.$#'
821-
identifier: booleanNot.alwaysTrue
822-
count: 1
823-
path: ../../../htdocs/admin/notification.php
824-
825-
-
826-
message: '#^Right side of && is always true\.$#'
827-
identifier: booleanAnd.rightAlwaysTrue
828-
count: 3
829-
path: ../../../htdocs/admin/notification.php
830-
831801
-
832802
message: '#^If condition is always true\.$#'
833803
identifier: if.alwaysTrue
@@ -7428,12 +7398,6 @@ parameters:
74287398
count: 1
74297399
path: ../../../htdocs/core/modules/facture/doc/pdf_crabe.modules.php
74307400

7431-
-
7432-
message: '#^Ternary operator condition is always false\.$#'
7433-
identifier: ternary.alwaysFalse
7434-
count: 1
7435-
path: ../../../htdocs/core/modules/facture/doc/pdf_crabe.modules.php
7436-
74377401
-
74387402
message: '#^Call to function is_object\(\) with object will always evaluate to true\.$#'
74397403
identifier: function.alreadyNarrowedType
@@ -11916,30 +11880,12 @@ parameters:
1191611880
count: 1
1191711881
path: ../../../htdocs/product/class/productbatch.class.php
1191811882

11919-
-
11920-
message: '#^Property Productbatch\:\:\$batch \(string\) in isset\(\) is not nullable\.$#'
11921-
identifier: isset.property
11922-
count: 3
11923-
path: ../../../htdocs/product/class/productbatch.class.php
11924-
11925-
-
11926-
message: '#^Property Productbatch\:\:\$eatby \(int\|string\) in isset\(\) is not nullable\.$#'
11927-
identifier: isset.property
11928-
count: 1
11929-
path: ../../../htdocs/product/class/productbatch.class.php
11930-
1193111883
-
1193211884
message: '#^Property Productbatch\:\:\$qty \(float\) in isset\(\) is not nullable\.$#'
1193311885
identifier: isset.property
1193411886
count: 3
1193511887
path: ../../../htdocs/product/class/productbatch.class.php
1193611888

11937-
-
11938-
message: '#^Property Productbatch\:\:\$sellby \(int\|string\) in isset\(\) is not nullable\.$#'
11939-
identifier: isset.property
11940-
count: 1
11941-
path: ../../../htdocs/product/class/productbatch.class.php
11942-
1194311889
-
1194411890
message: '#^Loose comparison using \=\= between '''' and 0 will always evaluate to false\.$#'
1194511891
identifier: equal.alwaysFalse
@@ -12516,30 +12462,6 @@ parameters:
1251612462
count: 1
1251712463
path: ../../../htdocs/product/stats/supplier_proposal.php
1251812464

12519-
-
12520-
message: '#^Call to function method_exists\(\) with \$this\(Entrepot\) and ''getLibStatut'' will always evaluate to true\.$#'
12521-
identifier: function.alreadyNarrowedType
12522-
count: 1
12523-
path: ../../../htdocs/product/stock/class/entrepot.class.php
12524-
12525-
-
12526-
message: '#^Call to function method_exists\(\) with \$this\(Entrepot\) and ''getNomUrl'' will always evaluate to true\.$#'
12527-
identifier: function.alreadyNarrowedType
12528-
count: 1
12529-
path: ../../../htdocs/product/stock/class/entrepot.class.php
12530-
12531-
-
12532-
message: '#^Call to function property_exists\(\) with \$this\(Entrepot\) and ''lieu'' will always evaluate to true\.$#'
12533-
identifier: function.alreadyNarrowedType
12534-
count: 1
12535-
path: ../../../htdocs/product/stock/class/entrepot.class.php
12536-
12537-
-
12538-
message: '#^Negated boolean expression is always true\.$#'
12539-
identifier: booleanNot.alwaysTrue
12540-
count: 2
12541-
path: ../../../htdocs/product/stock/class/entrepot.class.php
12542-
1254312465
-
1254412466
message: '#^Call to function is_object\(\) with object will always evaluate to true\.$#'
1254512467
identifier: function.alreadyNarrowedType
@@ -12552,66 +12474,12 @@ parameters:
1255212474
count: 1
1255312475
path: ../../../htdocs/product/stock/class/productlot.class.php
1255412476

12555-
-
12556-
message: '#^Property Productlot\:\:\$batch \(string\) in isset\(\) is not nullable\.$#'
12557-
identifier: isset.property
12558-
count: 4
12559-
path: ../../../htdocs/product/stock/class/productlot.class.php
12560-
12561-
-
12562-
message: '#^Property Productlot\:\:\$eatby \(int\|string\) in isset\(\) is not nullable\.$#'
12563-
identifier: isset.property
12564-
count: 2
12565-
path: ../../../htdocs/product/stock/class/productlot.class.php
12566-
12567-
-
12568-
message: '#^Property Productlot\:\:\$eol_date \(int\|string\) in isset\(\) is not nullable\.$#'
12569-
identifier: isset.property
12570-
count: 2
12571-
path: ../../../htdocs/product/stock/class/productlot.class.php
12572-
1257312477
-
1257412478
message: '#^Property Productlot\:\:\$fk_product \(int\) in isset\(\) is not nullable\.$#'
1257512479
identifier: isset.property
1257612480
count: 4
1257712481
path: ../../../htdocs/product/stock/class/productlot.class.php
1257812482

12579-
-
12580-
message: '#^Property Productlot\:\:\$fk_user_creat \(int\) in isset\(\) is not nullable\.$#'
12581-
identifier: isset.property
12582-
count: 4
12583-
path: ../../../htdocs/product/stock/class/productlot.class.php
12584-
12585-
-
12586-
message: '#^Property Productlot\:\:\$fk_user_modif \(int\) in isset\(\) is not nullable\.$#'
12587-
identifier: isset.property
12588-
count: 4
12589-
path: ../../../htdocs/product/stock/class/productlot.class.php
12590-
12591-
-
12592-
message: '#^Property Productlot\:\:\$import_key \(string\) in isset\(\) is not nullable\.$#'
12593-
identifier: isset.property
12594-
count: 4
12595-
path: ../../../htdocs/product/stock/class/productlot.class.php
12596-
12597-
-
12598-
message: '#^Property Productlot\:\:\$manufacturing_date \(int\|string\) in isset\(\) is not nullable\.$#'
12599-
identifier: isset.property
12600-
count: 2
12601-
path: ../../../htdocs/product/stock/class/productlot.class.php
12602-
12603-
-
12604-
message: '#^Property Productlot\:\:\$scrapping_date \(int\|string\) in isset\(\) is not nullable\.$#'
12605-
identifier: isset.property
12606-
count: 2
12607-
path: ../../../htdocs/product/stock/class/productlot.class.php
12608-
12609-
-
12610-
message: '#^Property Productlot\:\:\$sellby \(int\|string\) in isset\(\) is not nullable\.$#'
12611-
identifier: isset.property
12612-
count: 2
12613-
path: ../../../htdocs/product/stock/class/productlot.class.php
12614-
1261512483
-
1261612484
message: '#^Negated boolean expression is always true\.$#'
1261712485
identifier: booleanNot.alwaysTrue
@@ -12630,12 +12498,6 @@ parameters:
1263012498
count: 4
1263112499
path: ../../../htdocs/product/stock/class/productstockentrepot.class.php
1263212500

12633-
-
12634-
message: '#^Property ProductStockEntrepot\:\:\$import_key \(string\) in isset\(\) is not nullable\.$#'
12635-
identifier: isset.property
12636-
count: 4
12637-
path: ../../../htdocs/product/stock/class/productstockentrepot.class.php
12638-
1263912501
-
1264012502
message: '#^Variable \$action might not be defined\.$#'
1264112503
identifier: variable.undefined
@@ -12816,24 +12678,6 @@ parameters:
1281612678
count: 1
1281712679
path: ../../../htdocs/product/stock/stocktransfer/class/stocktransfer.class.php
1281812680

12819-
-
12820-
message: '#^If condition is always true\.$#'
12821-
identifier: if.alwaysTrue
12822-
count: 1
12823-
path: ../../../htdocs/product/stock/stocktransfer/class/stocktransfer.class.php
12824-
12825-
-
12826-
message: '#^Negated boolean expression is always true\.$#'
12827-
identifier: booleanNot.alwaysTrue
12828-
count: 1
12829-
path: ../../../htdocs/product/stock/stocktransfer/class/stocktransfer.class.php
12830-
12831-
-
12832-
message: '#^Property StockTransfer\:\:\$status \(int\) in isset\(\) is not nullable\.$#'
12833-
identifier: isset.property
12834-
count: 1
12835-
path: ../../../htdocs/product/stock/stocktransfer/class/stocktransfer.class.php
12836-
1283712681
-
1283812682
message: '#^If condition is always false\.$#'
1283912683
identifier: if.alwaysFalse
@@ -12852,36 +12696,12 @@ parameters:
1285212696
count: 1
1285312697
path: ../../../htdocs/product/stock/stocktransfer/class/stocktransferline.class.php
1285412698

12855-
-
12856-
message: '#^Property StockTransfer\:\:\$status \(int\) in isset\(\) is not nullable\.$#'
12857-
identifier: isset.property
12858-
count: 1
12859-
path: ../../../htdocs/product/stock/stocktransfer/stocktransfer_agenda.php
12860-
1286112699
-
1286212700
message: '#^If condition is always true\.$#'
1286312701
identifier: if.alwaysTrue
1286412702
count: 1
1286512703
path: ../../../htdocs/product/stock/stocktransfer/stocktransfer_card.php
1286612704

12867-
-
12868-
message: '#^Property StockTransfer\:\:\$status \(int\) in isset\(\) is not nullable\.$#'
12869-
identifier: isset.property
12870-
count: 1
12871-
path: ../../../htdocs/product/stock/stocktransfer/stocktransfer_card.php
12872-
12873-
-
12874-
message: '#^Variable \$i might not be defined\.$#'
12875-
identifier: variable.undefined
12876-
count: 1
12877-
path: ../../../htdocs/product/stock/stocktransfer/stocktransfer_card.php
12878-
12879-
-
12880-
message: '#^Property StockTransfer\:\:\$status \(int\) in isset\(\) is not nullable\.$#'
12881-
identifier: isset.property
12882-
count: 1
12883-
path: ../../../htdocs/product/stock/stocktransfer/stocktransfer_contact.php
12884-
1288512705
-
1288612706
message: '#^Variable \$result might not be defined\.$#'
1288712707
identifier: variable.undefined
@@ -12894,12 +12714,6 @@ parameters:
1289412714
count: 1
1289512715
path: ../../../htdocs/product/stock/stocktransfer/stocktransfer_list.php
1289612716

12897-
-
12898-
message: '#^Ternary operator condition is always false\.$#'
12899-
identifier: ternary.alwaysFalse
12900-
count: 2
12901-
path: ../../../htdocs/product/stock/tpl/stockcorrection.tpl.php
12902-
1290312717
-
1290412718
message: '#^Right side of && is always true\.$#'
1290512719
identifier: booleanAnd.rightAlwaysTrue

dev/tools/phan/baseline.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ return [
1313
// PhanTypeMismatchProperty : 100+ occurrences
1414
// PhanTypeMismatchArgument : 65+ occurrences
1515
// PhanUndeclaredGlobalVariable : 60+ occurrences
16-
// PhanTypeMismatchArgumentNullable : 40+ occurrences
16+
// PhanTypeMismatchArgumentNullable : 20+ occurrences
1717
// PhanTypeInvalidDimOffset : 15+ occurrences
1818
// PhanTypeMismatchDimFetch : 10+ occurrences
1919
// PhanUndeclaredMethod : 8 occurrences
@@ -82,7 +82,7 @@ return [
8282
'htdocs/core/class/cgenericdic.class.php' => ['PhanUndeclaredProperty'],
8383
'htdocs/core/class/commonobject.class.php' => ['PhanParamTooMany', 'PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
8484
'htdocs/core/class/commonpeople.class.php' => ['PhanUndeclaredProperty'],
85-
'htdocs/core/class/conf.class.php' => ['PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchProperty'],
85+
'htdocs/core/class/conf.class.php' => ['PhanTypeMismatchProperty'],
8686
'htdocs/core/class/ctyperesource.class.php' => ['PhanUndeclaredProperty'],
8787
'htdocs/core/class/dolgraph.class.php' => ['PhanUndeclaredProperty'],
8888
'htdocs/core/class/emailsenderprofile.class.php' => ['PhanUndeclaredProperty'],
@@ -121,7 +121,7 @@ return [
121121
'htdocs/core/modules/holiday/mod_holiday_immaculate.php' => ['PhanTypeMismatchArgument'],
122122
'htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php' => ['PhanUndeclaredProperty'],
123123
'htdocs/core/modules/hrm/mod_evaluation_advanced.php' => ['PhanUndeclaredProperty'],
124-
'htdocs/core/modules/import/import_csv.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty'],
124+
'htdocs/core/modules/import/import_csv.modules.php' => ['PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty'],
125125
'htdocs/core/modules/import/import_xlsx.modules.php' => ['PhanTypeMismatchProperty'],
126126
'htdocs/core/modules/member/modules_cards.php' => ['PhanTypeMismatchArgument'],
127127
'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanUndeclaredProperty'],
@@ -162,7 +162,7 @@ return [
162162
'htdocs/expedition/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
163163
'htdocs/expedition/class/expedition.class.php' => ['PhanUndeclaredProperty'],
164164
'htdocs/expensereport/card.php' => ['PhanUndeclaredProperty'],
165-
'htdocs/expensereport/class/expensereport.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
165+
'htdocs/expensereport/class/expensereport.class.php' => ['PhanTypeMismatchArgument'],
166166
'htdocs/expensereport/payment/info.php' => ['PhanUndeclaredGlobalVariable'],
167167
'htdocs/externalsite/frames.php' => ['PhanUndeclaredGlobalVariable'],
168168
'htdocs/fichinter/card-rec.php' => ['PhanUndeclaredGlobalVariable'],
@@ -223,7 +223,6 @@ return [
223223
'htdocs/projet/tasks.php' => ['PhanTypeMismatchArgument'],
224224
'htdocs/projet/tasks/time.php' => ['PhanTypeInvalidDimOffset', 'PhanUndeclaredProperty'],
225225
'htdocs/projet/tasks/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
226-
'htdocs/public/members/new.php' => ['PhanUndeclaredGlobalVariable'],
227226
'htdocs/public/payment/newpayment.php' => ['PhanUndeclaredProperty'],
228227
'htdocs/public/project/suggestbooth.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
229228
'htdocs/public/project/suggestconference.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
@@ -253,7 +252,6 @@ return [
253252
'htdocs/supplier_proposal/card.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
254253
'htdocs/supplier_proposal/class/api_supplier_proposals.class.php' => ['PhanUndeclaredProperty'],
255254
'htdocs/supplier_proposal/class/supplier_proposal.class.php' => ['PhanUndeclaredProperty'],
256-
'htdocs/takepos/index.php' => ['PhanPluginUndeclaredVariableIsset'],
257255
'htdocs/takepos/invoice.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'],
258256
'htdocs/takepos/split.php' => ['PhanPluginUndeclaredVariableIsset'],
259257
'htdocs/ticket/card.php' => ['PhanUndeclaredProperty'],

htdocs/admin/geoipmaxmind.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858

5959
$gimcdf = GETPOST("GEOIPMAXMIND_COUNTRY_DATAFILE");
6060

61-
if (!$error && $gimcdf && !preg_match('/\.(dat|mmdb)$/', $gimcdf)) {
61+
if ($gimcdf && !preg_match('/\.(dat|mmdb)$/', $gimcdf)) {
6262
setEventMessages($langs->trans("ErrorFileMustHaveFormat", '.dat|.mmdb'), null, 'errors');
6363
$error++;
6464
}

htdocs/admin/menus/edit.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Copyright (C) 2009-2011 Regis Houssin <[email protected]>
55
* Copyright (C) 2016 Meziane Sof <[email protected]>
66
* Copyright (C) 2024 MDW <[email protected]>
7-
* Copyright (C) 2024 Frédéric France <[email protected]>
7+
* Copyright (C) 2024-2025 Frédéric France <[email protected]>
88
*
99
* This program is free software; you can redistribute it and/or modify
1010
* it under the terms of the GNU General Public License as published by
@@ -106,7 +106,7 @@
106106
$langs->load("errors");
107107

108108
$error = 0;
109-
if (!$error && !GETPOST('menu_handler')) {
109+
if (!GETPOST('menu_handler')) {
110110
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("MenuHandler")), null, 'errors');
111111
$action = 'create';
112112
$error++;
@@ -191,7 +191,7 @@
191191
}
192192

193193
$error = 0;
194-
if (!$error && !GETPOST('url')) {
194+
if (!GETPOST('url')) {
195195
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("URL")), null, 'errors');
196196
$action = 'create';
197197
$error++;

0 commit comments

Comments
 (0)