Skip to content

Commit

Permalink
fix phpstan (#28735)
Browse files Browse the repository at this point in the history
* fix phpstan

* fix phpstan

* fix phpstan
  • Loading branch information
frederic34 authored Mar 10, 2024
1 parent 96ef01c commit 895aa5e
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 32 deletions.
4 changes: 2 additions & 2 deletions htdocs/delivery/class/delivery.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public function create($user)
* @param array $array_options Array options
* @return int Return integer <0 if KO, >0 if OK
*/
public function create_line($origin_id, $qty, $fk_product, $description, $array_options = null)
public function create_line($origin_id, $qty, $fk_product, $description, $array_options = [])
{
// phpcs:enable
$error = 0;
Expand Down Expand Up @@ -636,7 +636,7 @@ public function update_line($id, $array_options = [])
* @param array $array_options Array options
* @return void
*/
public function addline($origin_id, $qty, $array_options = null)
public function addline($origin_id, $qty, $array_options = [])
{
global $conf;

Expand Down
8 changes: 4 additions & 4 deletions htdocs/expedition/class/expedition.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ public function create($user, $notrigger = 0)
* @param array $array_options extrafields array
* @return int Return integer <0 if KO, line_id if OK
*/
public function create_line($entrepot_id, $origin_line_id, $qty, $rang = 0, $array_options = null)
public function create_line($entrepot_id, $origin_line_id, $qty, $rang = 0, $array_options = [])
{
//phpcs:enable
global $user;
Expand Down Expand Up @@ -525,7 +525,7 @@ public function create_line($entrepot_id, $origin_line_id, $qty, $rang = 0, $arr
* @param array $array_options extrafields array
* @return int Return integer <0 if KO, >0 if OK
*/
public function create_line_batch($line_ext, $array_options = 0)
public function create_line_batch($line_ext, $array_options = [])
{
// phpcs:enable
$error = 0;
Expand Down Expand Up @@ -898,7 +898,7 @@ public function create_delivery($user)
* @param array $array_options extrafields array
* @return int Return integer <0 if KO, >0 if OK
*/
public function addline($entrepot_id, $id, $qty, $array_options = 0)
public function addline($entrepot_id, $id, $qty, $array_options = [])
{
global $conf, $langs;

Expand Down Expand Up @@ -981,7 +981,7 @@ public function addline($entrepot_id, $id, $qty, $array_options = 0)
* @param array $array_options extrafields array
* @return int Return integer <0 if KO, >0 if OK
*/
public function addline_batch($dbatch, $array_options = 0)
public function addline_batch($dbatch, $array_options = [])
{
// phpcs:enable
global $conf, $langs;
Expand Down
6 changes: 3 additions & 3 deletions htdocs/fourn/class/fournisseur.commande.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2210,8 +2210,8 @@ public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0.0, $txloca
* @param int $entrepot Id of warehouse to add product
* @param double $price Unit Price for PMP value calculation (Unit price without Tax and taking into account discount)
* @param string $comment Comment for stock movement
* @param integer $eatby eat-by date
* @param integer $sellby sell-by date
* @param int|string $eatby eat-by date
* @param int|string $sellby sell-by date
* @param string $batch Lot number
* @param int $fk_commandefourndet Id of supplier order line
* @param int $notrigger 1 = notrigger
Expand Down Expand Up @@ -2894,7 +2894,7 @@ public function setStatus($user, $status)
* @param string $ref_supplier Supplier ref
* @return int Return integer < 0 if error, > 0 if ok
*/
public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $price_base_type = 'HT', $info_bits = 0, $type = 0, $notrigger = 0, $date_start = '', $date_end = '', $array_options = 0, $fk_unit = null, $pu_ht_devise = 0, $ref_supplier = '')
public function updateline($rowid, $desc, $pu, $qty, $remise_percent, $txtva, $txlocaltax1 = 0, $txlocaltax2 = 0, $price_base_type = 'HT', $info_bits = 0, $type = 0, $notrigger = 0, $date_start = '', $date_end = '', $array_options = [], $fk_unit = null, $pu_ht_devise = 0, $ref_supplier = '')
{
global $mysoc, $conf, $langs;
dol_syslog(get_class($this)."::updateline $rowid, $desc, $pu, $qty, $remise_percent, $txtva, $price_base_type, $info_bits, $type, $fk_unit");
Expand Down
11 changes: 6 additions & 5 deletions htdocs/multicurrency/class/multicurrency.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Copyright (C) 2015 Florian Henry <[email protected]>
* Copyright (C) 2015 Raphaël Doursenaud <[email protected]>
* Copyright (C) 2016 Pierre-Henry Favre <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -519,12 +520,12 @@ public static function getIdFromCode($dbs, $code)
/**
* Get id and rate of currency from code
*
* @param DoliDB $dbs Object db
* @param string $code Code value search
* @param integer $date_document Date from document (propal, order, invoice, ...)
* @param DoliDB $dbs Object db
* @param string $code Code value search
* @param integer|string $date_document Date from document (propal, order, invoice, ...)
*
* @return array [0] => id currency
* [1] => rate
* @return array [0] => id currency
* [1] => rate
*/
public static function getIdAndTxFromCode($dbs, $code, $date_document = '')
{
Expand Down
30 changes: 15 additions & 15 deletions htdocs/product/class/product.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -5719,21 +5719,21 @@ public function correct_stock($user, $id_entrepot, $nbpiece, $movement, $label =
/**
* Adjust stock in a warehouse for product with batch number
*
* @param User $user user asking change
* @param int $id_entrepot id of warehouse
* @param double $nbpiece nb of units (should be always positive, use $movement to decide if we add or remove)
* @param int $movement 0 = add, 1 = remove
* @param string $label Label of stock movement
* @param double $price Price to use for stock eval
* @param integer $dlc eat-by date
* @param integer $dluo sell-by date
* @param string $lot Lot number
* @param string $inventorycode Inventory code
* @param string $origin_element Origin element type
* @param int $origin_id Origin id of element
* @param int $disablestockchangeforsubproduct Disable stock change for sub-products of kit (useful only if product is a subproduct)
* @param Extrafields $extrafields Array of extrafields
* @param boolean $force_update_batch Force update batch
* @param User $user user asking change
* @param int $id_entrepot id of warehouse
* @param double $nbpiece nb of units (should be always positive, use $movement to decide if we add or remove)
* @param int $movement 0 = add, 1 = remove
* @param string $label Label of stock movement
* @param double $price Price to use for stock eval
* @param int|string $dlc eat-by date
* @param int|string $dluo sell-by date
* @param string $lot Lot number
* @param string $inventorycode Inventory code
* @param string $origin_element Origin element type
* @param int $origin_id Origin id of element
* @param int $disablestockchangeforsubproduct Disable stock change for sub-products of kit (useful only if product is a subproduct)
* @param Extrafields $extrafields Array of extrafields
* @param boolean $force_update_batch Force update batch
* @return int Return integer <0 if KO, >0 if OK
*/
public function correct_stock_batch($user, $id_entrepot, $nbpiece, $movement, $label = '', $price = 0, $dlc = '', $dluo = '', $lot = '', $inventorycode = '', $origin_element = '', $origin_id = null, $disablestockchangeforsubproduct = 0, $extrafields = null, $force_update_batch = false)
Expand Down
6 changes: 3 additions & 3 deletions htdocs/product/stock/class/mouvementstock.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -813,9 +813,9 @@ private function _createSubProduct($user, $idProduct, $entrepot_id, $qty, $type,
* @param int $qty Quantity
* @param int $price Price
* @param string $label Label of stock movement
* @param integer|string $datem Force date of movement
* @param integer $eatby eat-by date
* @param integer $sellby sell-by date
* @param int|string $datem Force date of movement
* @param int|string $eatby eat-by date
* @param int|string $sellby sell-by date
* @param string $batch batch number
* @param int $id_product_batch Id product_batch
* @param string $inventorycode Inventory code
Expand Down

0 comments on commit 895aa5e

Please sign in to comment.