Fix phpcs

This commit is contained in:
Laurent Destailleur 2020-04-26 23:18:09 +02:00
parent b20d85b198
commit 31ba277da7
6 changed files with 15 additions and 24 deletions

View File

@ -185,7 +185,7 @@ class Cpaiement
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
if (null !== $ref) {
$sql .= ' WHERE t.entity IN ('.getEntity('c_paiement').')';
$sql .= ' AND t.code = '.'\''.$ref.'\'';
$sql .= " AND t.code = '".$this->db->escape($ref)."'";
} else {
$sql .= ' WHERE t.id = '.$id;
}

View File

@ -1534,34 +1534,25 @@ class SMTPs
$content .= "--".$this->_getBoundary('alternative')."\r\n";
}
$content .= 'Content-Type: '.$_content['mimeType'].'; '
// . 'charset="' . $this->getCharSet() . '"';
. 'charset='.$this->getCharSet().'';
$content .= 'Content-Type: '.$_content['mimeType'].'; charset='.$this->getCharSet();
// $content .= ( $type == 'html') ? '; name="HTML Part"' : '';
$content .= "\r\n";
// $content .= 'Content-Transfer-Encoding: ';
// $content .= ($type == 'html') ? 'quoted-printable' : $this->getTransEncodeType();
// $content .= "\r\n"
// . 'Content-Disposition: inline' . "\r\n"
// . 'Content-Description: ' . $type . ' message' . "\r\n";
if ($this->getMD5flag())
$content .= 'Content-MD5: '.$_content['md5']."\r\n";
if ($this->getMD5flag()) {
$content .= 'Content-MD5: '.$_content['md5']."\r\n";
}
$content .= "\r\n".$_content['data']."\r\n";
if (!key_exists('image', $this->_msgContent) && $_content['dataText'] && !empty($conf->global->MAIN_MAIL_USE_MULTI_PART)) // Add plain text message part after html part
{
$content .= "--".$this->_getBoundary('alternative')."--"."\r\n";
$content .= "--".$this->_getBoundary('alternative')."--\r\n";
}
$content .= "\r\n";
}
}
// Close message boundries
// $content .= "\r\n--" . $this->_getBoundary() . '--' . "\r\n" ;
$content .= "--".$this->_getBoundary('mixed').'--'."\r\n";
}

View File

@ -1325,7 +1325,7 @@ class DoliDBSqlite3 extends DoliDB
if ($this->db)
{
$newname = preg_replace('/_/', '', $name);
$localname = __CLASS__.'::'.'db'.$newname;
$localname = __CLASS__.'::db'.$newname;
$reflectClass = new ReflectionClass(__CLASS__);
$reflectFunction = $reflectClass->getMethod('db'.$newname);
if ($arg_count < 0) {

View File

@ -2330,7 +2330,7 @@ else
print '</a>';
if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES))
{
print ' &nbsp; - &nbsp; '.'<a href="" class="commonlink aattachtodoc reposition">'.$langs->trans("AttachTheNewLineToTheDocument");
print ' &nbsp; - &nbsp; <a href="" class="commonlink aattachtodoc reposition">'.$langs->trans("AttachTheNewLineToTheDocument");
print img_picto($langs->trans("AttachTheNewLineToTheDocument"), 'chevron-down', '', false, 0, 0, '', 'marginleftonly');
print '</a>';
}
@ -2478,7 +2478,7 @@ else
print '</a>';
if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES))
{
print ' &nbsp; - &nbsp; '.'<a href="" class="commonlink aattachtodoc reposition">'.$langs->trans("AttachTheNewLineToTheDocument");
print ' &nbsp; - &nbsp; <a href="" class="commonlink aattachtodoc reposition">'.$langs->trans("AttachTheNewLineToTheDocument");
print img_picto($langs->trans("AttachTheNewLineToTheDocument"), 'chevron-down', '', false, 0, 0, '', 'marginleftonly');
print '</a>';
}

View File

@ -325,13 +325,13 @@ class AdherentTest extends PHPUnit\Framework\TestCase
$conf->global->MAIN_FIRSTNAME_NAME_POSITION = 0; // Force setup for firstname+lastname
$template = '__CIVILITY__,__FIRSTNAME__,__LASTNAME__,__FULLNAME__,__COMPANY__,'.
'__ADDRESS__,__ZIP__,__TOWN__,__COUNTRY__,__EMAIL__,__BIRTH__,__PHOTO__,__LOGIN__';
$template = '__CIVILITY__,__FIRSTNAME__,__LASTNAME__,__FULLNAME__,__COMPANY__,';
$template .= '__ADDRESS__,__ZIP__,__TOWN__,__COUNTRY__,__EMAIL__,__BIRTH__,__PHOTO__,__LOGIN__';
// If option to store clear password has been set, we get 'dolibspec' into PASSWORD field.
$expected = ',New firstname,New name,New firstname New name,'.
'New company label,New address,New zip,New town,Belgium,newemail@newemail.com,'.dol_print_date($localobject->birth, 'day').',,'.
'newlogin';
$expected = ',New firstname,New name,New firstname New name,';
$expected .= 'New company label,New address,New zip,New town,Belgium,newemail@newemail.com,'.dol_print_date($localobject->birth, 'day').',,';
$expected .= 'newlogin';
$result = $localobject->makeSubstitution($template);
print __METHOD__." result=".$result."\n";

View File

@ -336,7 +336,7 @@ class FilesLibTest extends PHPUnit\Framework\TestCase
$result=dol_copy($file, $conf->admin->dir_temp.'/file.csv', 0, 1);
print __METHOD__." result=".$result."\n";
$this->assertGreaterThanOrEqual(1, $result, 'copy file ('.$file.') into a dir that exists ('.$conf->admin->dir_temp.'/file.csv'.')'); // Should be 1
$this->assertGreaterThanOrEqual(1, $result, 'copy file ('.$file.') into a dir that exists ('.$conf->admin->dir_temp.'/file.csv)'); // Should be 1
// Again to test with overwriting=0
$result=dol_copy($file, $conf->admin->dir_temp.'/file.csv', 0, 0);