Browse Source

Fix phpcs

Laurent Destailleur 2 years ago
parent
commit
d83fb9e774
2 changed files with 3 additions and 5 deletions
  1. 0 1
      htdocs/product/class/product.class.php
  2. 3 4
      htdocs/societe/class/societe.class.php

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

@@ -6302,7 +6302,6 @@ class Product extends CommonObject
 		} else {
 			return $user->rights->service;
 		}
-		
 	}
 
 	/**

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

@@ -3668,12 +3668,12 @@ class Societe extends CommonObject
 	 * @param   array       $parents        List of companies ID found
 	 * @return	array
 	 */
-	public function getParentsForCompany($company_id, $parents = [])
+	public function getParentsForCompany($company_id, $parents = array())
 	{
 		global $langs;
 
 		if ($company_id > 0) {
-			$sql = "SELECT parent FROM " . MAIN_DB_PREFIX . "societe WHERE rowid = $company_id";
+			$sql = "SELECT parent FROM " . MAIN_DB_PREFIX . "societe WHERE rowid = ".((int) $company_id);
 			$resql = $this->db->query($sql);
 			if ($resql) {
 				if ($obj = $this->db->fetch_object($resql)) {
@@ -3691,8 +3691,7 @@ class Societe extends CommonObject
 			}
 		}
 		// Return a default value when $company_id is not greater than 0
-	return -1;
-		
+		return array();
 	}
 
 	// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps