Browse Source

Fix warning

Laurent Destailleur 2 years ago
parent
commit
85d91c82e8

+ 14 - 2
htdocs/comm/propal/class/propal.class.php

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

+ 6 - 0
htdocs/core/class/commonobject.class.php

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

+ 9 - 1
htdocs/core/class/lessc.class.php

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

+ 2 - 0
htdocs/core/lib/company.lib.php

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

+ 1 - 1
htdocs/fichinter/class/fichinter.class.php

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

+ 5 - 8
htdocs/fichinter/class/fichinterrec.class.php

@@ -661,18 +661,15 @@ class FichinterRec extends Fichinter
 	 *  Used to build previews or test instances.
 	 *	id must be 0 if object instance is a specimen.
 	 *
-	 *	@param	string		$option		''=Create a specimen fichinter with lines, 'nolines'=No lines
 	 *  @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();
-		$arraynow = dol_getdate($now);
-		$nownotime = dol_mktime(0, 0, 0, $arraynow['mon'], $arraynow['mday'], $arraynow['year']);
-
-		parent::initAsSpecimen($option);
+		parent::initAsSpecimen();
 
 		$this->usenewprice = 1;
 	}

+ 1 - 1
htdocs/theme/md/style.css.php

@@ -93,7 +93,7 @@ if (GETPOST('lang', 'aZ09')) {
 	$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
 }
 

+ 1 - 1
qodana.yaml

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