fix: phpstan (#26721)

* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* fix phpstan

* fix: phpstan

* fix: phpstan
This commit is contained in:
HENRY Florian 2023-11-19 00:52:16 +01:00 committed by GitHub
parent 7706c9ef23
commit d5343cfedb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 7 deletions

View file

@ -142,6 +142,13 @@ abstract class CommonInvoice extends CommonObject
public $close_note;
/**
* ! Populate by Payment module like stripe
* @var string message return by Online Payment module
*/
public $postactionmessages;
/**
* Standard invoice
*/
@ -689,13 +696,13 @@ abstract class CommonInvoice extends CommonObject
{
$subtypeLabel = '';
if ($table === 'facture' || $table === 'facture_fourn') {
$sql = "SELECT s.label FROM " . MAIN_DB_PREFIX . $table . " AS f";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "c_invoice_subtype AS s ON f.subtype = s.rowid";
$sql = "SELECT s.label FROM " . $this->db->prefix() . $table . " AS f";
$sql .= " INNER JOIN " . $this->db->prefix() . "c_invoice_subtype AS s ON f.subtype = s.rowid";
$sql .= " WHERE f.ref = '".$this->db->escape($this->ref)."'";
} elseif ($table === 'facture_rec' || $table === 'facture_fourn_rec') {
$sql = "SELECT s.label FROM " . MAIN_DB_PREFIX . $table . " AS f";
$sql .= " INNER JOIN " . MAIN_DB_PREFIX . "c_invoice_subtype AS s ON f.subtype = s.rowid";
$sql .= " WHERE f.titre = '".$this->db->escape($this->titre)."'";
$sql = "SELECT s.label FROM " . $this->db->prefix() . $table . " AS f";
$sql .= " INNER JOIN " . $this->db->prefix() . "c_invoice_subtype AS s ON f.subtype = s.rowid";
$sql .= " WHERE f.titre = '".$this->db->escape($this->title)."'";
} else {
return -1;
}

View file

@ -1780,7 +1780,14 @@ abstract class CommonObject
$result = $this->db->fetch_object($query);
return $this->fetch($result->rowid);
if (method_exists($this, 'fetch')) {
return $this->fetch($result->rowid);
} else {
$this->error = 'Fetch method not implemented on '.get_class($this);
dol_syslog(get_class($this).'::fetchOneLike Error='.$this->error, LOG_ERR);
array_push($this->errors, $this->error);
return -1;
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@ -9550,7 +9557,7 @@ abstract class CommonObject
$fieldvalues['fk_user_creat'] = $user->id;
}
if (array_key_exists('pass_crypted', $fieldvalues)) {
$fieldvalues['pass_crypted'] = dol_hash($object->pass);
$fieldvalues['pass_crypted'] = dol_hash($this->pass);
}
unset($fieldvalues['rowid']); // The field 'rowid' is reserved field name for autoincrement field so we don't need it into insert.
if (array_key_exists('ref', $fieldvalues)) {