Fix warning

This commit is contained in:
Laurent Destailleur 2023-01-03 17:34:51 +01:00
parent fce5968510
commit 85d91c82e8
8 changed files with 39 additions and 14 deletions

View File

@ -454,6 +454,8 @@ class Propal extends CommonObject
$this->lines[] = $line; $this->lines[] = $line;
} }
return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@ -2108,6 +2110,8 @@ class Propal extends CommonObject
return -1 * $error; return -1 * $error;
} }
} }
return -1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@ -2164,6 +2168,8 @@ class Propal extends CommonObject
return -1 * $error; return -1 * $error;
} }
} }
return -1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@ -2235,6 +2241,8 @@ class Propal extends CommonObject
return -1 * $error; return -1 * $error;
} }
} }
return -1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@ -2417,9 +2425,9 @@ class Propal extends CommonObject
$this->db->rollback(); $this->db->rollback();
return -1 * $error; return -1 * $error;
} }
} else {
return -1;
} }
return -1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@ -2480,6 +2488,8 @@ class Propal extends CommonObject
return -1 * $error; return -1 * $error;
} }
} }
return -1;
} }
@ -2542,6 +2552,8 @@ class Propal extends CommonObject
return -1 * $error; return -1 * $error;
} }
} }
return -1;
} }

View File

@ -3338,6 +3338,8 @@ abstract class CommonObject
$row = $this->db->fetch_row($resql); $row = $this->db->fetch_row($resql);
return $row[0]; return $row[0];
} }
return 0;
} }
/** /**
@ -3361,6 +3363,8 @@ abstract class CommonObject
$row = $this->db->fetch_row($resql); $row = $this->db->fetch_row($resql);
return $row[0]; return $row[0];
} }
return 0;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@ -3406,6 +3410,8 @@ abstract class CommonObject
return $row[0]; return $row[0];
} }
} }
return 0;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps

View File

@ -1011,6 +1011,7 @@ class Lessc
if ($list[0] == "list" && isset($list[2][$idx - 1])) { if ($list[0] == "list" && isset($list[2][$idx - 1])) {
return $list[2][$idx - 1]; return $list[2][$idx - 1];
} }
return;
} }
protected function lib_isnumber($value) protected function lib_isnumber($value)
@ -1305,6 +1306,7 @@ class Lessc
if (!is_null($color = $this->coerceColor($value))) { if (!is_null($color = $this->coerceColor($value))) {
return isset($color[4]) ? $color[4] : 1; return isset($color[4]) ? $color[4] : 1;
} }
return;
} }
// set the alpha of the color // set the alpha of the color
@ -1835,6 +1837,7 @@ class Lessc
} }
return null; return null;
} }
return null;
} }
// make something string like into a string // make something string like into a string
@ -1930,6 +1933,8 @@ class Lessc
array_unshift($strRight[2], $left); array_unshift($strRight[2], $left);
return $strRight; return $strRight;
} }
return '';
} }
@ -1953,6 +1958,7 @@ class Lessc
if ($op == '+' || $op == '*') { if ($op == '+' || $op == '*') {
return $this->op_color_number($op, $rgt, $lft); return $this->op_color_number($op, $rgt, $lft);
} }
return;
} }
protected function op_color_number($op, $lft, $rgt) protected function op_color_number($op, $lft, $rgt)
@ -3133,7 +3139,7 @@ class lessc_parser
} }
// an import statement // an import statement
protected function import(&$out) protected function import(&$out, $value = '')
{ {
if (!$this->literal('@import')) { if (!$this->literal('@import')) {
return false; return false;
@ -3147,6 +3153,8 @@ class lessc_parser
$out = array("import", $value); $out = array("import", $value);
return true; return true;
} }
return false;
} }
protected function mediaQueryList(&$out) protected function mediaQueryList(&$out)

View File

@ -652,6 +652,8 @@ function getState($id, $withcode = '', $dbtouse = 0, $withregion = 0, $outputlan
} else { } else {
dol_print_error($dbtouse, ''); dol_print_error($dbtouse, '');
} }
return '';
} }
/** /**

View File

@ -1300,7 +1300,7 @@ class Fichinter extends CommonObject
*/ */
public function initAsSpecimen() public function initAsSpecimen()
{ {
global $user, $langs, $conf; global $langs;
$now = dol_now(); $now = dol_now();

View File

@ -661,18 +661,15 @@ class FichinterRec extends Fichinter
* Used to build previews or test instances. * Used to build previews or test instances.
* id must be 0 if object instance is a specimen. * id must be 0 if object instance is a specimen.
* *
* @param string $option ''=Create a specimen fichinter with lines, 'nolines'=No lines
* @return void * @return void
*/ */
public function initAsSpecimen($option = '') public function initAsSpecimen()
{ {
global $user, $langs, $conf; //$now = dol_now();
//$arraynow = dol_getdate($now);
//$nownotime = dol_mktime(0, 0, 0, $arraynow['mon'], $arraynow['mday'], $arraynow['year']);
$now = dol_now(); parent::initAsSpecimen();
$arraynow = dol_getdate($now);
$nownotime = dol_mktime(0, 0, 0, $arraynow['mon'], $arraynow['mday'], $arraynow['year']);
parent::initAsSpecimen($option);
$this->usenewprice = 1; $this->usenewprice = 1;
} }

View File

@ -93,7 +93,7 @@ if (GETPOST('lang', 'aZ09')) {
$langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL $langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL
} }
if (GETPOSTISSET('THEME_DARKMODEENABLED', 'int')) { if (GETPOSTISSET('THEME_DARKMODEENABLED')) {
$conf->global->THEME_DARKMODEENABLED = GETPOST('THEME_DARKMODEENABLED', 'int'); // If darkmode was forced on URL $conf->global->THEME_DARKMODEENABLED = GETPOST('THEME_DARKMODEENABLED', 'int'); // If darkmode was forced on URL
} }

View File

@ -80,4 +80,4 @@ exclude:
- name: PhpParameterNameChangedDuringInheritanceInspection - name: PhpParameterNameChangedDuringInheritanceInspection
- name: PhpDuplicateSwitchCaseBodyInspection - name: PhpDuplicateSwitchCaseBodyInspection
- name: PhpNestedDirNameCallsCanBeReplacedWithLevelParameterInspection - name: PhpNestedDirNameCallsCanBeReplacedWithLevelParameterInspection
- name: PhpPointlessBooleanExpressionInConditionInspection