Skip to content

Commit

Permalink
Merge branch 'develop' into fix/PhanPossiblyUnsetPropertyOfThis
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy authored Mar 8, 2024
2 parents a45b29b + bb6cf2c commit 68faf91
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions dev/tools/phan/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@
// Dolibarr uses a lot of internal deprecated stuff, not reporting
'PhanDeprecatedProperty',
'PhanDeprecatedFunction',
'PhanCompatibleNegativeStringOffset',
// Dolibarr has quite a few strange noop assignments like $abc=$abc;
'PhanPluginDuplicateExpressionAssignment',
// Nulls are likely mostly false positives
Expand Down
3 changes: 3 additions & 0 deletions dev/tools/phan/config_extended.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@
// Add any issue types (such as 'PhanUndeclaredMethod')
// here to inhibit them from being reported
'suppress_issue_types' => [
'PhanCompatibleNegativeStringOffset', // return false positive

'PhanPluginWhitespaceTab', // Dolibarr used tabs
'PhanPluginCanUsePHP71Void', // Dolibarr is maintaining 7.0 compatibility
'PhanPluginShortArray', // Dolibarr uses array()
Expand All @@ -335,6 +337,7 @@
'PhanPluginCanUseReturnType', // Fixer - Report/Add return types in the function definition (function abc(string $var) (adds string)
'PhanPluginCanUseNullableParamType', // Fixer - Report/Add nullable parameter types in the function definition
'PhanPluginCanUseNullableReturnType', // Fixer - Report/Add nullable return types in the function definition

'PhanPluginNonBoolBranch', // Not essential - 31240+ occurrences
'PhanPluginNumericalComparison', // Not essential - 19870+ occurrences
'PhanTypeMismatchArgument', // Not essential - 12300+ occurrences
Expand Down
2 changes: 2 additions & 0 deletions dev/tools/phan/config_fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@
// Add any issue types (such as 'PhanUndeclaredMethod')
// here to inhibit them from being reported
'suppress_issue_types' => [
'PhanCompatibleNegativeStringOffset', // return false positive

'PhanPluginWhitespaceTab', // Dolibarr used tabs
'PhanPluginCanUsePHP71Void', // Dolibarr is maintaining 7.0 compatibility
'PhanPluginShortArray', // Dolibarr uses array()
Expand Down
4 changes: 2 additions & 2 deletions htdocs/comm/propal/class/propal.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2704,7 +2704,7 @@ public function closeProposal($user, $status, $note = '', $notrigger = 0)
$resql = $this->db->query($sql);
if ($resql) {
// Status self::STATUS_REFUSED by default
$modelpdf = getDolGlobalString('PROPALE_ADDON_PDF_ODT_CLOSED') ? $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED : $this->model_pdf;
$modelpdf = getDolGlobalString('PROPALE_ADDON_PDF_ODT_CLOSED', $this->model_pdf);
$trigger_name = 'PROPAL_CLOSE_REFUSED'; // used later in call_trigger()

if ($status == self::STATUS_SIGNED) { // Status self::STATUS_SIGNED
Expand Down Expand Up @@ -2814,7 +2814,7 @@ public function classifyBilled(User $user, $notrigger = 0, $note = '')
}

if (!$error) {
$modelpdf = $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED ? $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED : $this->model_pdf;
$modelpdf = getDolGlobalString('PROPALE_ADDON_PDF_ODT_CLOSED', $this->model_pdf);

if (!getDolGlobalString('MAIN_DISABLE_PDF_AUTOUPDATE')) {
// Define output language
Expand Down
4 changes: 2 additions & 2 deletions htdocs/compta/facture/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -1820,7 +1820,7 @@
$date_end,
0,
$lines[$i]->info_bits,
$lines[$i]->fk_remise_except,
isset($lines[$i]->fk_remise_except) ? $lines[$i]->fk_remise_except : null,
'HT',
0,
$product_type,
Expand All @@ -1829,7 +1829,7 @@
$object->origin,
$lines[$i]->rowid,
$fk_parent_line,
$lines[$i]->fk_fournprice,
isset($lines[$i]->fk_fournprice) ? $lines[$i]->fk_fournprice : null,
$lines[$i]->pa_ht,
$label,
$array_options,
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/actions_sendmails.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -434,10 +434,10 @@
setEventMessages($mesg, null, 'mesgs');

$moreparam = '';
if (isset($paramname2) || isset($paramval2)) {
if (isset($paramval2)) {
$moreparam .= '&'.($paramname2 ? $paramname2 : 'mid').'='.$paramval2;
}
header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname ? $paramname : 'id').'='.(is_object($object) ? $object->id : '').$moreparam);
header('Location: '.$_SERVER["PHP_SELF"].'?'.($paramname ?? 'id').'='.(is_object($object) ? $object->id : '').$moreparam);
exit;
} else {
$langs->load("other");
Expand Down
2 changes: 1 addition & 1 deletion htdocs/societe/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@


// Update linked member
if (!$error && $object->fk_soc > 0) {
if (!$error && isset($object->fk_soc) && $object->fk_soc > 0) {
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent";
$sql .= " SET fk_soc = NULL WHERE fk_soc = ".((int) $socid);
if (!$object->db->query($sql)) {
Expand Down

0 comments on commit 68faf91

Please sign in to comment.