Skip to content

Commit

Permalink
Qual: Fix phan notices not seen locally
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeweerd committed Feb 1, 2025
1 parent 5813319 commit 2b0feab
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 18 deletions.
5 changes: 3 additions & 2 deletions htdocs/bom/bom_net_needs.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2017-2020 Laurent Destailleur <[email protected]>
* Copyright (C) 2019-2024 Frédéric France <[email protected]>
* Copyright (C) 2025 MDW <[email protected]>
*
* 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
Expand Down Expand Up @@ -135,7 +136,7 @@
$formfile = new FormFile($db);

$title = $langs->trans('BOM');
$help_url ='EN:Module_BOM';
$help_url = 'EN:Module_BOM';

llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-bom page-net_needs');

Expand Down Expand Up @@ -330,7 +331,7 @@
if ($useunit) {
require_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php';
$unit = new CUnits($db);
$unit->fetch($elem['fk_unit']);
$unit->fetch((int) $elem['fk_unit']);
print(isset($unit->label) ? "&nbsp;".$langs->trans(ucwords($unit->label))."&nbsp;" : '');
}
print '</td>';
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/class/commoninvoice.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Copyright (C) 2012-2014 Raphaël Doursenaud <[email protected]>
* Copyright (C) 2023 Nick Fragoulis
* Copyright (C) 2024-2025 Frédéric France <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024-2025 MDW <[email protected]>
* Copyright (C) 2024 Alexandre Spangaro <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -2005,7 +2005,7 @@ public function buildSwitzerlandQRString()
$s .= ($this->multicurrency_code ? $this->multicurrency_code : $conf->currency)."\n";
// Buyer
$s .= "S\n";
$s .= dol_trunc($this->thirdparty->name, 70, 'right', 'UTF-8', 1)."\n";
$s .= dol_trunc((string) $this->thirdparty->name, 70, 'right', 'UTF-8', 1)."\n";
$addresslinearray = explode("\n", $this->thirdparty->address);
$s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1
$s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2
Expand Down
8 changes: 4 additions & 4 deletions htdocs/core/db/pgsql.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Copyright (C) 2012 Yann Droneaud <[email protected]>
* Copyright (C) 2012 Florian Henry <[email protected]>
* Copyright (C) 2015 Marcos García <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024-2025 MDW <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -53,11 +53,11 @@ class DoliDBPgsql extends DoliDB
const VERSIONMIN = '9.0.0'; // Version min database

/**
* @var boolean $unescapeslashquot Set this to 1 when calling SQL queries, to say that SQL is not standard but already escaped for Mysql. Used by PostgreSQL driver
* @var boolean Set this to 1 when calling SQL queries, to say that SQL is not standard but already escaped for Mysql. Used by PostgreSQL driver
*/
public $unescapeslashquot = false;
/**
* @var boolean $standard_conforming_strings Set this to true if postgres accept only standard encoding of string using '' and not \'
* @var boolean Set this to true if postgres accept only standard encoding of string using '' and not \'
*/
public $standard_conforming_strings = false;

Expand Down Expand Up @@ -951,7 +951,7 @@ public function DDLCreateDb($database, $charset = '', $collation = '', $owner =
//print $charset.' '.setlocale(LC_CTYPE,'0'); exit;

// NOTE: Do not use ' around the database name
$sql = "CREATE DATABASE ".$this->escape($database)." OWNER '".$this->escape($owner)."' ENCODING '".$this->escape($charset)."'";
$sql = "CREATE DATABASE ".$this->escape($database)." OWNER '".$this->escape($owner)."' ENCODING '".$this->escape((string) $charset)."'";

dol_syslog($sql, LOG_DEBUG);
$ret = $this->query($sql);
Expand Down
12 changes: 6 additions & 6 deletions htdocs/exports/export.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Copyright (C) 2012 Charles-Fr BENKE <[email protected]>
* Copyright (C) 2015 Juanjo Menent <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024-2025 MDW <[email protected]>
*
* 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
Expand Down Expand Up @@ -631,7 +631,7 @@
$entityicon = $tmparray[0];
$entitylang = $tmparray[1];
}
print img_object('', $entityicon).' '.$langs->trans($entitylang);
print img_object('', $entityicon).' '.$langs->trans((string) $entitylang);
print '</td>';

$text = (empty($objexport->array_export_special[0][$code]) ? '' : '<i>');
Expand All @@ -641,7 +641,7 @@
} else {
$text .= $langs->trans($label);
}
$text .=(empty($objexport->array_export_special[0][$code]) ? '' : '</i>');
$text .= (empty($objexport->array_export_special[0][$code]) ? '' : '</i>');

$tablename = getablenamefromfield($code, $sqlmaxforexport);
$htmltext = '<b>'.$langs->trans("Name").":</b> ".$text.'<br>';
Expand Down Expand Up @@ -823,7 +823,7 @@
$entityicon = $tmparray[0];
$entitylang = $tmparray[1];
}
print img_object('', $entityicon).' '.$langs->trans($entitylang);
print img_object('', $entityicon).' '.$langs->trans((string) $entitylang);
print '</td>';

// Field name
Expand All @@ -837,7 +837,7 @@
} else {
$text .= $langs->trans($label);
}
$text .=(empty($objexport->array_export_special[0][$code]) ? '' : '</i>');
$text .= (empty($objexport->array_export_special[0][$code]) ? '' : '</i>');

$tablename = getablenamefromfield($code, $sqlmaxforexport);
$htmltext = '<b>'.$langs->trans("Name").':</b> '.$text.'<br>';
Expand Down Expand Up @@ -1046,7 +1046,7 @@
} else {
$text .= $langs->trans($labelName);
}
$text .=(empty($objexport->array_export_special[0][$code]) ? '' : '</i>');
$text .= (empty($objexport->array_export_special[0][$code]) ? '' : '</i>');

$tablename = getablenamefromfield($code, $sqlmaxforexport);
$htmltext = '<b>'.$langs->trans("Name").':</b> '.$text.'<br>';
Expand Down
2 changes: 1 addition & 1 deletion htdocs/website/class/website.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,7 @@ public function exportWebSite()
$line .= "'".$this->db->escape($objectpageold->status)."', ";
$line .= "'".$this->db->idate($objectpageold->date_creation)."', ";
$line .= "'".$this->db->idate($objectpageold->date_modification)."', ";
$line .= ($objectpageold->import_key ? "'".$this->db->escape($objectpageold->import_key)."'" : "null").", ";
$line .= ($objectpageold->import_key ? "'".$this->db->escape((string) $objectpageold->import_key)."'" : "null").", ";
$line .= "'".$this->db->escape($objectpageold->grabbed_from)."', ";
$line .= "'".$this->db->escape($objectpageold->type_container)."', ";

Expand Down
6 changes: 3 additions & 3 deletions htdocs/website/class/websitepage.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Copyright (C) 2015 Raphaël Doursenaud <[email protected]>
* Copyright (C) 2020 Nicolas ZABOURI <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024-2025 MDW <[email protected]>
*
* 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
Expand Down Expand Up @@ -163,7 +163,7 @@ class WebsitePage extends CommonObject
public $fk_object;

/**
* @var int Another ID that is the $id but with an offset so that ID of pages of the website start at 1
* @var int Another ID that is the but with an offset so that ID of pages of the website start at 1
*/
public $newid;

Expand Down Expand Up @@ -661,7 +661,7 @@ public function update(User $user, $notrigger = 0)
return -1;
}
$tmppage = new WebsitePage($this->db);
$tmppage->fetch($this->fk_page);
$tmppage->fetch((int) $this->fk_page);
if ($tmppage->lang == $this->lang) {
$this->error = "ErrorLanguageOfTranslatedPageIsSameThanThisPage";
return -1;
Expand Down

0 comments on commit 2b0feab

Please sign in to comment.