Skip to content

Commit 6a7de54

Browse files
authored
Merge branch 'develop' into patch-8
2 parents 6a2cba6 + 738b85a commit 6a7de54

42 files changed

Lines changed: 717 additions & 836 deletions

Some content is hidden

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

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ The following changes may create regressions for some external modules, but were
3232
* Because of new TRIGGER_PREFIX property triggers SUPPLIER_PRODUCT_BUYPRICE_XXX are renamed to PRODUCT_BUYPRICE_XXX.
3333
* Function img_pdf() has been removed. Replace it with img_picto('', 'pdf.png') if you were using it.
3434
* The method run_trigger() was deprecated 10+ years ago in favor of runTrigger(). It has been removed. Change your trigger file if you still use it.
35+
* Property ->picto of module descriptors must contains the image extension if it is not a font awesome tag. Example: $this->picto="mymoduleimg.png";
3536

3637

3738
***** ChangeLog for 22.0.2 compared to 22.0.1 *****

dev/build/phpstan/phpstan-baseline.neon

Lines changed: 0 additions & 192 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,12 +1410,6 @@ parameters:
14101410
count: 1
14111411
path: ../../../htdocs/asset/tpl/depreciation_options_edit.tpl.php
14121412

1413-
-
1414-
message: '#^Variable \$db might not be defined\.$#'
1415-
identifier: variable.undefined
1416-
count: 1
1417-
path: ../../../htdocs/asset/tpl/depreciation_options_view.tpl.php
1418-
14191413
-
14201414
message: '#^Variable \$parameters might not be defined\.$#'
14211415
identifier: variable.undefined
@@ -4032,12 +4026,6 @@ parameters:
40324026
count: 1
40334027
path: ../../../htdocs/compta/tva/clients.php
40344028

4035-
-
4036-
message: '#^Variable \$description might not be defined\.$#'
4037-
identifier: variable.undefined
4038-
count: 8
4039-
path: ../../../htdocs/compta/tva/clients.php
4040-
40414029
-
40424030
message: '#^Strict comparison using \=\=\= between true and true will always evaluate to true\.$#'
40434031
identifier: identical.alwaysTrue
@@ -7422,12 +7410,6 @@ parameters:
74227410
count: 1
74237411
path: ../../../htdocs/core/modules/cheque/doc/pdf_blochet.class.php
74247412

7425-
-
7426-
message: '#^Parameter \#2 \$object of method BordereauChequeBlochet\:\:_pagefoot\(\) expects CommonObject, null given\.$#'
7427-
identifier: argument.type
7428-
count: 1
7429-
path: ../../../htdocs/core/modules/cheque/doc/pdf_blochet.class.php
7430-
74317413
-
74327414
message: '#^Property Commande\:\:\$availability \(string\) in isset\(\) is not nullable\.$#'
74337415
identifier: isset.property
@@ -8658,42 +8640,18 @@ parameters:
86588640
count: 1
86598641
path: ../../../htdocs/core/tpl/extrafields_list_array_fields.tpl.php
86608642

8661-
-
8662-
message: '#^Variable \$db might not be defined\.$#'
8663-
identifier: variable.undefined
8664-
count: 1
8665-
path: ../../../htdocs/core/tpl/extrafields_list_print_fields.tpl.php
8666-
86678643
-
86688644
message: '#^Variable \$i might not be defined\.$#'
86698645
identifier: variable.undefined
86708646
count: 1
86718647
path: ../../../htdocs/core/tpl/extrafields_list_print_fields.tpl.php
86728648

8673-
-
8674-
message: '#^Variable \$obj might not be defined\.$#'
8675-
identifier: variable.undefined
8676-
count: 1
8677-
path: ../../../htdocs/core/tpl/extrafields_list_print_fields.tpl.php
8678-
86798649
-
86808650
message: '#^Variable \$totalarray might not be defined\.$#'
86818651
identifier: variable.undefined
86828652
count: 2
86838653
path: ../../../htdocs/core/tpl/extrafields_list_print_fields.tpl.php
86848654

8685-
-
8686-
message: '#^Variable \$db might not be defined\.$#'
8687-
identifier: variable.undefined
8688-
count: 8
8689-
path: ../../../htdocs/core/tpl/extrafields_list_search_sql.tpl.php
8690-
8691-
-
8692-
message: '#^Variable \$sql might not be defined\.$#'
8693-
identifier: variable.undefined
8694-
count: 7
8695-
path: ../../../htdocs/core/tpl/extrafields_list_search_sql.tpl.php
8696-
86978655
-
86988656
message: '#^Variable \$param might not be defined\.$#'
86998657
identifier: variable.undefined
@@ -8712,36 +8670,6 @@ parameters:
87128670
count: 1
87138671
path: ../../../htdocs/core/tpl/filemanager.tpl.php
87148672

8715-
-
8716-
message: '#^Variable \$action might not be defined\.$#'
8717-
identifier: variable.undefined
8718-
count: 6
8719-
path: ../../../htdocs/core/tpl/filemanager.tpl.php
8720-
8721-
-
8722-
message: '#^Variable \$ecmdir might not be defined\.$#'
8723-
identifier: variable.undefined
8724-
count: 1
8725-
path: ../../../htdocs/core/tpl/filemanager.tpl.php
8726-
8727-
-
8728-
message: '#^Variable \$filepathnoext might not be defined\.$#'
8729-
identifier: variable.undefined
8730-
count: 1
8731-
path: ../../../htdocs/core/tpl/filemanager.tpl.php
8732-
8733-
-
8734-
message: '#^Variable \$module in empty\(\) always exists and is not falsy\.$#'
8735-
identifier: empty.variable
8736-
count: 1
8737-
path: ../../../htdocs/core/tpl/filemanager.tpl.php
8738-
8739-
-
8740-
message: '#^Variable \$pageid might not be defined\.$#'
8741-
identifier: variable.undefined
8742-
count: 1
8743-
path: ../../../htdocs/core/tpl/filemanager.tpl.php
8744-
87458673
-
87468674
message: '#^Variable \$websitekey might not be defined\.$#'
87478675
identifier: variable.undefined
@@ -8814,18 +8742,6 @@ parameters:
88148742
count: 2
88158743
path: ../../../htdocs/core/tpl/objectline_view.tpl.php
88168744

8817-
-
8818-
message: '#^Variable \$langs might not be defined\.$#'
8819-
identifier: variable.undefined
8820-
count: 4
8821-
path: ../../../htdocs/core/tpl/objectlinked_lineimport.tpl.php
8822-
8823-
-
8824-
message: '#^Variable \$object might not be defined\.$#'
8825-
identifier: variable.undefined
8826-
count: 3
8827-
path: ../../../htdocs/core/tpl/objectlinked_lineimport.tpl.php
8828-
88298745
-
88308746
message: '#^Variable \$langs might not be defined\.$#'
88318747
identifier: variable.undefined
@@ -8874,54 +8790,6 @@ parameters:
88748790
count: 1
88758791
path: ../../../htdocs/core/website.inc.php
88768792

8877-
-
8878-
message: '#^Variable \$conf might not be defined\.$#'
8879-
identifier: variable.undefined
8880-
count: 3
8881-
path: ../../../htdocs/core/website.inc.php
8882-
8883-
-
8884-
message: '#^Variable \$db might not be defined\.$#'
8885-
identifier: variable.undefined
8886-
count: 7
8887-
path: ../../../htdocs/core/website.inc.php
8888-
8889-
-
8890-
message: '#^Variable \$hookmanager might not be defined\.$#'
8891-
identifier: variable.undefined
8892-
count: 2
8893-
path: ../../../htdocs/core/website.inc.php
8894-
8895-
-
8896-
message: '#^Variable \$websitekey might not be defined\.$#'
8897-
identifier: variable.undefined
8898-
count: 2
8899-
path: ../../../htdocs/core/website.inc.php
8900-
8901-
-
8902-
message: '#^Loose comparison using \=\= between 1 and 0 will always evaluate to false\.$#'
8903-
identifier: equal.alwaysFalse
8904-
count: 1
8905-
path: ../../../htdocs/cron/card.php
8906-
8907-
-
8908-
message: '#^Negated boolean expression is always false\.$#'
8909-
identifier: booleanNot.alwaysFalse
8910-
count: 2
8911-
path: ../../../htdocs/cron/card.php
8912-
8913-
-
8914-
message: '#^Result of && is always false\.$#'
8915-
identifier: booleanAnd.alwaysFalse
8916-
count: 2
8917-
path: ../../../htdocs/cron/card.php
8918-
8919-
-
8920-
message: '#^Right side of && is always true\.$#'
8921-
identifier: booleanAnd.rightAlwaysTrue
8922-
count: 5
8923-
path: ../../../htdocs/cron/card.php
8924-
89258793
-
89268794
message: '#^Variable \$mc might not be defined\.$#'
89278795
identifier: variable.undefined
@@ -8940,12 +8808,6 @@ parameters:
89408808
count: 1
89418809
path: ../../../htdocs/cron/class/cronjob.class.php
89428810

8943-
-
8944-
message: '#^Ternary operator condition is always true\.$#'
8945-
identifier: ternary.alwaysTrue
8946-
count: 10
8947-
path: ../../../htdocs/cron/list.php
8948-
89498811
-
89508812
message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#'
89518813
identifier: empty.variable
@@ -15684,24 +15546,6 @@ parameters:
1568415546
count: 1
1568515547
path: ../../../htdocs/societe/class/companybankaccount.class.php
1568615548

15687-
-
15688-
message: '#^Call to function method_exists\(\) with \$this\(Societe\) and ''getLibStatut'' will always evaluate to true\.$#'
15689-
identifier: function.alreadyNarrowedType
15690-
count: 1
15691-
path: ../../../htdocs/societe/class/societe.class.php
15692-
15693-
-
15694-
message: '#^Call to function method_exists\(\) with \$this\(Societe\) and ''getNomUrl'' will always evaluate to true\.$#'
15695-
identifier: function.alreadyNarrowedType
15696-
count: 1
15697-
path: ../../../htdocs/societe/class/societe.class.php
15698-
15699-
-
15700-
message: '#^Call to function property_exists\(\) with \$this\(Societe\) and ''code_client'' will always evaluate to true\.$#'
15701-
identifier: function.alreadyNarrowedType
15702-
count: 1
15703-
path: ../../../htdocs/societe/class/societe.class.php
15704-
1570515549
-
1570615550
message: '#^Loose comparison using \!\= between ''email''\|''mobile'' and ''poste'' will always evaluate to true\.$#'
1570715551
identifier: notEqual.alwaysTrue
@@ -15714,24 +15558,12 @@ parameters:
1571415558
count: 1
1571515559
path: ../../../htdocs/societe/class/societe.class.php
1571615560

15717-
-
15718-
message: '#^Negated boolean expression is always true\.$#'
15719-
identifier: booleanNot.alwaysTrue
15720-
count: 6
15721-
path: ../../../htdocs/societe/class/societe.class.php
15722-
1572315561
-
1572415562
message: '#^Property Contact\:\:\$roles \(array\<int, array\{id\: int, socid\: int, element\: string, source\: string, code\: string, label\: string\}\>\|null\) does not accept non\-empty\-list\<string\>\.$#'
1572515563
identifier: assign.propertyType
1572615564
count: 1
1572715565
path: ../../../htdocs/societe/class/societe.class.php
1572815566

15729-
-
15730-
message: '#^Property Societe\:\:\$bank_account \(Account\|string\) in isset\(\) is not nullable\.$#'
15731-
identifier: isset.property
15732-
count: 1
15733-
path: ../../../htdocs/societe/class/societe.class.php
15734-
1573515567
-
1573615568
message: '#^Property Societe\:\:\$client \(int\) in isset\(\) is not nullable\.$#'
1573715569
identifier: isset.property
@@ -15750,12 +15582,6 @@ parameters:
1575015582
count: 1
1575115583
path: ../../../htdocs/societe/class/societe.class.php
1575215584

15753-
-
15754-
message: '#^Property Societe\:\:\$stcomm_id \(int\) in isset\(\) is not nullable\.$#'
15755-
identifier: isset.property
15756-
count: 1
15757-
path: ../../../htdocs/societe/class/societe.class.php
15758-
1575915585
-
1576015586
message: '#^Property Societe\:\:\$typent_id \(int\) in isset\(\) is not nullable\.$#'
1576115587
identifier: isset.property
@@ -15894,18 +15720,6 @@ parameters:
1589415720
count: 1
1589515721
path: ../../../htdocs/societe/price.php
1589615722

15897-
-
15898-
message: '#^Variable \$db might not be defined\.$#'
15899-
identifier: variable.undefined
15900-
count: 1
15901-
path: ../../../htdocs/societe/tpl/linesalesrepresentative.tpl.php
15902-
15903-
-
15904-
message: '#^Variable \$object might not be defined\.$#'
15905-
identifier: variable.undefined
15906-
count: 4
15907-
path: ../../../htdocs/societe/tpl/linesalesrepresentative.tpl.php
15908-
1590915723
-
1591015724
message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#'
1591115725
identifier: empty.variable
@@ -16140,12 +15954,6 @@ parameters:
1614015954
count: 5
1614115955
path: ../../../htdocs/takepos/ajax/ajax.php
1614215956

16143-
-
16144-
message: '#^Variable \$conf might not be defined\.$#'
16145-
identifier: variable.undefined
16146-
count: 1
16147-
path: ../../../htdocs/takepos/css/pos.css.php
16148-
1614915957
-
1615015958
message: '#^Right side of && is always true\.$#'
1615115959
identifier: booleanAnd.rightAlwaysTrue

dev/tools/phan/baseline.txt

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,20 @@ return [
1111
// # Issue statistics:
1212
// PhanUndeclaredProperty : 420+ occurrences
1313
// PhanTypeMismatchProperty : 100+ occurrences
14-
// PhanTypeMismatchArgument : 70+ occurrences
14+
// PhanTypeMismatchArgument : 65+ occurrences
1515
// PhanUndeclaredGlobalVariable : 60+ occurrences
1616
// PhanTypeMismatchArgumentNullable : 40+ occurrences
1717
// PhanTypeInvalidDimOffset : 15+ occurrences
18-
// PhanTypeMismatchDimFetch : 15+ occurrences
18+
// PhanTypeMismatchDimFetch : 10+ occurrences
1919
// PhanUndeclaredMethod : 8 occurrences
2020
// PhanPossiblyUndeclaredGlobalVariable : 6 occurrences
2121
// PhanTypeArraySuspiciousNull : 6 occurrences
2222
// PhanTypeComparisonFromArray : 6 occurrences
2323
// PhanTypeExpectedObjectPropAccess : 5 occurrences
24-
// PhanTypeMismatchArgumentProbablyReal : 5 occurrences
2524
// PhanPluginDuplicateArrayKey : 4 occurrences
2625
// PhanParamTooMany : 3 occurrences
2726
// PhanPluginUndeclaredVariableIsset : 3 occurrences
27+
// PhanTypeMismatchArgumentProbablyReal : 2 occurrences
2828
// PhanPossiblyUndeclaredVariable : 1 occurrence
2929
// PhanTypeExpectedObjectPropAccessButGotNull : 1 occurrence
3030
// PhanTypeMismatchReturn : 1 occurrence
@@ -34,7 +34,7 @@ return [
3434
'htdocs/bookcal/class/calendar.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
3535
'htdocs/categories/viewcat.php' => ['PhanUndeclaredProperty'],
3636
'htdocs/comm/action/index.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
37-
'htdocs/comm/action/pertype.php' => ['PhanTypeComparisonFromArray', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchDimFetch'],
37+
'htdocs/comm/action/pertype.php' => ['PhanTypeComparisonFromArray', 'PhanTypeExpectedObjectPropAccess'],
3838
'htdocs/comm/action/peruser.php' => ['PhanTypeComparisonFromArray', 'PhanTypeMismatchArgument'],
3939
'htdocs/comm/card.php' => ['PhanTypeMismatchArgument'],
4040
'htdocs/comm/mailing/index.php' => ['PhanUndeclaredProperty'],
@@ -53,7 +53,6 @@ return [
5353
'htdocs/compta/clients.php' => ['PhanUndeclaredGlobalVariable'],
5454
'htdocs/compta/facture/card-rec.php' => ['PhanTypeMismatchArgument'],
5555
'htdocs/compta/facture/card.php' => ['PhanUndeclaredProperty'],
56-
'htdocs/compta/facture/class/api_invoices.class.php' => ['PhanTypeMismatchArgumentProbablyReal'],
5756
'htdocs/compta/facture/class/facture-rec.class.php' => ['PhanUndeclaredProperty'],
5857
'htdocs/compta/facture/class/facture.class.php' => ['PhanUndeclaredProperty'],
5958
'htdocs/compta/localtax/card.php' => ['PhanUndeclaredGlobalVariable'],
@@ -72,7 +71,7 @@ return [
7271
'htdocs/compta/tva/index.php' => ['PhanTypeMismatchArgument'],
7372
'htdocs/compta/tva/quadri_detail.php' => ['PhanTypeArraySuspiciousNull', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument'],
7473
'htdocs/contrat/card.php' => ['PhanUndeclaredGlobalVariable'],
75-
'htdocs/core/actions_addupdatedelete.inc.php' => ['PhanTypeMismatchDimFetch', 'PhanUndeclaredProperty'],
74+
'htdocs/core/actions_addupdatedelete.inc.php' => ['PhanUndeclaredProperty'],
7675
'htdocs/core/actions_massactions.inc.php' => ['PhanUndeclaredProperty'],
7776
'htdocs/core/actions_sendmails.inc.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
7877
'htdocs/core/ajax/ajaxdirtree.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty', 'PhanUndeclaredGlobalVariable'],
@@ -105,7 +104,6 @@ return [
105104
'htdocs/core/menus/standard/auguria.lib.php' => ['PhanTypeMismatchArgument'],
106105
'htdocs/core/modules/asset/mod_asset_advanced.php' => ['PhanUndeclaredProperty'],
107106
'htdocs/core/modules/bom/mod_bom_advanced.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
108-
'htdocs/core/modules/cheque/doc/pdf_blochet.class.php' => ['PhanTypeMismatchArgumentProbablyReal'],
109107
'htdocs/core/modules/cheque/modules_chequereceipts.php' => ['PhanTypeMismatchArgument'],
110108
'htdocs/core/modules/commande/doc/pdf_einstein.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
111109
'htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'],
@@ -196,7 +194,6 @@ return [
196194
'htdocs/loan/document.php' => ['PhanUndeclaredProperty'],
197195
'htdocs/loan/note.php' => ['PhanUndeclaredProperty'],
198196
'htdocs/loan/payment/payment.php' => ['PhanUndeclaredProperty'],
199-
'htdocs/mrp/class/mo.class.php' => ['PhanTypeMismatchProperty'],
200197
'htdocs/mrp/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
201198
'htdocs/multicurrency/class/api_multicurrencies.class.php' => ['PhanTypeMismatchArgument'],
202199
'htdocs/multicurrency/class/multicurrency.class.php' => ['PhanTypeExpectedObjectPropAccess'],
@@ -228,7 +225,6 @@ return [
228225
'htdocs/projet/tasks/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'],
229226
'htdocs/public/members/new.php' => ['PhanUndeclaredGlobalVariable'],
230227
'htdocs/public/payment/newpayment.php' => ['PhanUndeclaredProperty'],
231-
'htdocs/public/payment/paymentok.php' => ['PhanTypeMismatchArgumentProbablyReal'],
232228
'htdocs/public/project/suggestbooth.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
233229
'htdocs/public/project/suggestconference.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
234230
'htdocs/public/project/viewandvote.php' => ['PhanUndeclaredGlobalVariable'],

0 commit comments

Comments
 (0)