Browse Source

Merge pull request #25185 from oussamanhairech/develop

qodana fix: missing returns
Laurent Destailleur 2 years ago
parent
commit
0ad5063b57

+ 1 - 0
htdocs/hrm/class/skill.class.php

@@ -417,6 +417,7 @@ class Skill extends CommonObject
 			$this->error = $skilldet->error;
 			return $this->lines;
 		}
+		return -1;
 	}
 
 

+ 2 - 0
htdocs/product/class/product.class.php

@@ -5524,6 +5524,7 @@ class Product extends CommonObject
 				return -1;
 			}
 		}
+		return -1;
 	}
 
 	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -6301,6 +6302,7 @@ class Product extends CommonObject
 		} else {
 			return $user->rights->service;
 		}
+		
 	}
 
 	/**

+ 4 - 0
htdocs/societe/class/societe.class.php

@@ -2282,6 +2282,7 @@ class Societe extends CommonObject
 
 			return 1;
 		}
+		return -1;
 	}
 
 	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -3689,6 +3690,9 @@ class Societe extends CommonObject
 				setEventMessage($langs->trans('GetCompanyParentsError', $this->db->lasterror()), 'errors');
 			}
 		}
+		// Return a default value when $company_id is not greater than 0
+	return -1;
+		
 	}
 
 	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps