Merge pull request #2556 from Dolibarr/scrutinizer-patch-1

Scrutinizer Auto-Fixes
This commit is contained in:
Laurent Destailleur 2015-04-06 12:26:01 +02:00
commit 323cc53553
21 changed files with 51 additions and 47 deletions

View File

@ -61,7 +61,7 @@ class LignePrelevement
* Recupere l'objet prelevement
*
* @param int $rowid id de la facture a recuperer
* @return void|int
* @return integer
*/
function fetch($rowid)
{

View File

@ -516,6 +516,10 @@ class CMailFile
// Encode subject according to RFC 2822 - http://en.wikipedia.org/wiki/MIME#Encoded-Word
/**
* @param string $stringtoencode
*/
function encodetorfc2822($stringtoencode)
{
global $conf;
@ -639,7 +643,7 @@ class CMailFile
/**
* Create SMTP headers (mode = 'mail')
*
* @return smtp headers
* @return string headers
*/
function write_smtpheaders()
{
@ -690,7 +694,7 @@ class CMailFile
*
* @param array $filename_list Array of filenames
* @param array $mimefilename_list Array of mime types
* @return array mime headers
* @return string mime headers
*/
function write_mimeheaders($filename_list, $mimefilename_list)
{

View File

@ -188,7 +188,7 @@ abstract class CommonInvoice extends CommonObject
* Return label of object status
*
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto
* @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
* @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
* @return string Label
*/
function getLibStatut($mode=0,$alreadypaid=-1)
@ -202,7 +202,7 @@ abstract class CommonInvoice extends CommonObject
* @param int $paye Status field paye
* @param int $status Id status
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto
* @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
* @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
* @param int $type Type facture
* @return string Libelle du statut
*/
@ -326,7 +326,7 @@ abstract class CommonInvoice extends CommonObject
* Renvoi une date limite de reglement de facture en fonction des
* conditions de reglements de la facture et date de facturation
*
* @param string $cond_reglement Condition of payment (code or id) to use. If 0, we use current condition.
* @param integer $cond_reglement Condition of payment (code or id) to use. If 0, we use current condition.
* @return date Date limite de reglement si ok, <0 si ko
*/
function calculate_date_lim_reglement($cond_reglement=0)

View File

@ -115,7 +115,7 @@ class DolGraph
* Set Y precision
*
* @param float $which_prec Precision
* @return string
* @return boolean
*/
function SetPrecisionY($which_prec)
{
@ -187,7 +187,7 @@ class DolGraph
* Set y label
*
* @param string $label Y label
* @return boolean True
* @return boolean|null True
*/
function SetYLabel($label)
{
@ -198,7 +198,7 @@ class DolGraph
* Set width
*
* @param int $w Width
* @return boolean True
* @return boolean|null True
*/
function SetWidth($w)
{
@ -554,7 +554,7 @@ class DolGraph
/**
* Return min value of all data
*
* @return int Max value of all data
* @return double Max value of all data
*/
function GetFloorMinValue()
{
@ -578,7 +578,7 @@ class DolGraph
*
* @param string $file Image file name to use to save onto disk (also used as javascript unique id)
* @param string $fileurl Url path to show image if saved onto disk
* @return void
* @return integer|null
*/
function draw($file,$fileurl='')
{

View File

@ -30,7 +30,7 @@ class InfoBox
/**
* Name of positions 0=Home, 1=...
*
* @return array Array with list of zones
* @return string[] Array with list of zones
*/
static function getListOfPagesForBoxes()
{

View File

@ -349,7 +349,7 @@ class Ldap
/**
* Change ldap protocol version to use.
*
* @return string version
* @return boolean version
*/
function setVersion() {
// LDAP_OPT_PROTOCOL_VERSION est une constante qui vaut 17
@ -360,7 +360,7 @@ class Ldap
/**
* changement du referrals.
*
* @return string referrals
* @return boolean referrals
*/
function setReferrals() {
// LDAP_OPT_REFERRALS est une constante qui vaut ?
@ -1314,7 +1314,7 @@ class Ldap
* Convertit le temps ActiveDirectory en Unix timestamp
*
* @param string $value AD time to convert
* @return string Unix timestamp
* @return integer Unix timestamp
*/
function convert_time($value)
{

View File

@ -296,7 +296,7 @@ class DoliDBSqlite extends DoliDB
* @param string $login login
* @param string $passwd password
* @param string $name name of database (not used for mysql, used for pgsql)
* @param string $port Port of database server
* @param integer $port Port of database server
* @return resource Database access handler
* @see close
*/
@ -459,7 +459,7 @@ class DoliDBSqlite extends DoliDB
/**
* Return datas as an array
*
* @param Resultset $resultset Resultset of request
* @param resource $resultset Resultset of request
* @return array Array
*/
function fetch_row($resultset)
@ -511,7 +511,7 @@ class DoliDBSqlite extends DoliDB
/**
* Free last resultset used.
*
* @param resultset $resultset Curseur de la requete voulue
* @param integer $resultset Curseur de la requete voulue
* @return void
*/
function free($resultset=0)
@ -629,7 +629,7 @@ class DoliDBSqlite extends DoliDB
*
* @param string $fieldorvalue Field name or value to encrypt
* @param int $withQuotes Return string with quotes
* @return return XXX(field) or XXX('value') or field or 'value'
* @return string XXX(field) or XXX('value') or field or 'value'
*/
function encrypt($fieldorvalue, $withQuotes=0)
{

View File

@ -61,7 +61,7 @@ else $genbarcode_loc = $conf->global->GENBARCODE_LOCATION;
*
* @param string $code Code
* @param string $encoding Encoding
* @param string $scale Scale
* @param integer $scale Scale
* @param string $mode 'png' or 'jpg' ...
*
*
@ -159,7 +159,7 @@ function barcode_encode($code,$encoding)
* Calculate EAN sum
*
* @param string $ean EAN to encode
* @return string Sum
* @return integer Sum
*/
function barcode_gen_ean_sum($ean)
{
@ -299,7 +299,7 @@ function barcode_encode_genbarcode($code,$encoding)
* @param string $mode png,gif,jpg (default='png')
* @param int $total_y the total height of the image ( default: scale * 60 )
* @param array $space default: $space[top] = 2 * $scale; $space[bottom]= 2 * $scale; $space[left] = 2 * $scale; $space[right] = 2 * $scale;
* @return void
* @return string|null
*/
function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0, $space = '')
{

View File

@ -452,7 +452,7 @@ function dol_count_nb_of_line($file)
* Return size of a file
*
* @param string $pathoffile Path of file
* @return string File size
* @return integer File size
*/
function dol_filesize($pathoffile)
{
@ -598,7 +598,7 @@ function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists)
*
* @param string $srcfile Source file (can't be a directory. use native php @rename() to move a directory)
* @param string $destfile Destination file (can't be a directory. use native php @rename() to move a directory)
* @param string $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK)
* @param integer $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK)
* @param int $overwriteifexists Overwrite file if exists (1 by default)
* @return boolean True if OK, false if KO
*/
@ -657,7 +657,7 @@ function dol_unescapefile($filename)
* @param string $dest_file Target full path filename ($_FILES['field']['name'])
* @param int $allowoverwrite 1=Overwrite target file if it already exists
* @param int $disablevirusscan 1=Disable virus scan
* @param string $uploaderrorcode Value of PHP upload error code ($_FILES['field']['error'])
* @param integer $uploaderrorcode Value of PHP upload error code ($_FILES['field']['error'])
* @param int $nohook Disable all hooks
* @param string $varfiles _FILES var name
* @return int >0 if OK, <0 or string if KO
@ -989,7 +989,7 @@ function dol_delete_preview($object)
* This should allow "grep" search.
* This feature is enabled only if option MAIN_DOC_CREATE_METAFILE is set.
*
* @param Object $object Object
* @param CommonObject $object Object
* @return int 0 if we did nothing, >0 success, <0 error
*/
function dol_meta_create($object)

View File

@ -42,7 +42,7 @@ abstract class ModelePDFDeliveryOrder extends CommonDocGenerator
* Return list of active generation modules
*
* @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show
* @param integer $maxfilenamelength Max length of value to show
* @return array List of templates
*/
static function liste_modeles($db,$maxfilenamelength=0)
@ -151,7 +151,7 @@ abstract class ModeleNumRefDeliveryOrder
* Create object on disk
*
* @param DoliDB $db objet base de donnee
* @param Object $object object delivery
* @param Livraison $object object delivery
* @param string $modele force le modele a utiliser ('' to not force)
* @param Translate $outputlangs objet lang a utiliser pour traduction
* @return int 0 if KO, 1 if OK

View File

@ -49,7 +49,7 @@ class PrintingDriver
* Return list of printing driver
*
* @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show
* @param integer $maxfilenamelength Max length of value to show
* @return array List of drivers
*/
static function listDrivers($db,$maxfilenamelength=0)

View File

@ -254,7 +254,7 @@ class printing_printgcp extends PrintingDriver
/**
* Login into Google Account
*
* @return string true or false
* @return boolean true or false
*/
function GoogleLogin()
{
@ -324,8 +324,8 @@ class printing_printgcp extends PrintingDriver
*
* @param string $url url to hit
* @param array $postfields array of post fields
* @param array $headers array of http headers
* @return array response from curl
* @param string[] $headers array of http headers
* @return string response from curl
*/
private function makeCurl($url,$postfields=array(),$headers=array())
{

View File

@ -819,7 +819,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
* Show payments table
*
* @param PDF $pdf Object PDF
* @param Object $object Object invoice
* @param FactureFournisseur $object Object invoice
* @param int $posy Position y in PDF
* @param Translate $outputlangs Object langs for output
* @return int <0 if KO, >0 if OK
@ -903,7 +903,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
* Show top header of page.
*
* @param PDF $pdf Object PDF
* @param Object $object Object to show
* @param FactureFournisseur $object Object to show
* @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output
* @return void
@ -1090,7 +1090,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
* Show footer of page. Need this->emetteur object
*
* @param PDF $pdf PDF
* @param Object $object Object to show
* @param FactureFournisseur $object Object to show
* @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text
* @return int Return height of bottom margin including footer text

View File

@ -44,7 +44,7 @@ abstract class ModelePDFSuppliersOrders extends CommonDocGenerator
* Return list of active generation models
*
* @param DoliDB $db Database handler
* @param string $maxfilenamelength Max length of value to show
* @param integer $maxfilenamelength Max length of value to show
* @return array List of templates
*/
static function liste_modeles($db,$maxfilenamelength=0)
@ -143,7 +143,7 @@ abstract class ModeleNumRefSuppliersOrders
* Create a document onto disk according to template model.
*
* @param DoliDB $db Database handler
* @param Object $object Object supplier order
* @param CommandeFournisseur $object Object supplier order
* @param string $modele Force template to use ('' to not force)
* @param Translate $outputlangs Object lang to use for traduction
* @param int $hidedetails Hide details of lines

View File

@ -321,7 +321,7 @@ class Loan extends CommonObject
* Return label of loan status (unpaid, paid)
*
* @param int $mode 0=label, 1=short label, 2=Picto + Short label, 3=Picto, 4=Picto + Label
* @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
* @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
* @return string Label
*/
function getLibStatut($mode=0,$alreadypaid=-1)
@ -334,7 +334,7 @@ class Loan extends CommonObject
*
* @param int $statut Id statut
* @param int $mode 0=Label, 1=Short label, 2=Picto + Short label, 3=Picto, 4=Picto + Label, 5=Short label + Picto
* @param double $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
* @param integer $alreadypaid 0=No payment already done, >0=Some payments were already done (we recommand to put here amount payed if you have it, 1 otherwise)
* @return string Label
*/
function LibStatut($statut,$mode=0,$alreadypaid=-1)
@ -447,7 +447,7 @@ class Loan extends CommonObject
* Information on record
*
* @param int $id Id of record
* @return void
* @return integer|null
*/
function info($id)
{

View File

@ -67,7 +67,7 @@ class ActionsCardService
* Assign custom values for canvas (for example into this->tpl to be used by templates)
*
* @param string $action Type of action
* @param string $id Id of object
* @param integer $id Id of object
* @param string $ref Ref of object
* @return void
*/

View File

@ -462,7 +462,7 @@ class Productbatch extends CommonObject
/**
* Return all batch detail records for given product and warehouse
*
* @param obj $db database object
* @param DoliDB $db database object
* @param int $fk_product_stock id product_stock for objet
* @param int $with_qty doesn't return line with 0 quantity
* @return int <0 if KO, >0 if OK

View File

@ -355,7 +355,7 @@ abstract class ActionsCardCommon
* Assign custom values for canvas (for example into this->tpl to be used by templates)
*
* @param string $action Type of action
* @param string $id Id of object
* @param integer $id Id of object
* @param string $ref Ref of object
* @return void
*/

View File

@ -92,7 +92,7 @@ class ActionsCardCompany extends ActionsCardCommon
* Assign custom values for canvas (for example into this->tpl to be used by templates)
*
* @param string $action Type of action
* @param string $id Id of object
* @param integer $id Id of object
* @param string $ref Ref of object
* @return void
*/

View File

@ -92,7 +92,7 @@ class ActionsCardIndividual extends ActionsCardCommon
* Assign custom values for canvas (for example into this->tpl to be used by templates)
*
* @param string $action Type of action
* @param string $id Id of object
* @param integer $id Id of object
* @param string $ref Ref of object
* @return void
*/

View File

@ -1578,7 +1578,7 @@ class Societe extends CommonObject
*
* @param User $user Filtre sur un user auteur des remises
* @param string $filter Filtre autre
* @param string $maxvalue Filter on max value for discount
* @param integer $maxvalue Filter on max value for discount
* @return int <0 if KO, Credit note amount otherwise
*/
function getAvailableDiscounts($user='',$filter='',$maxvalue=0)
@ -1728,7 +1728,7 @@ class Societe extends CommonObject
* @param int $withpicto Add picto into link (0=No picto, 1=Include picto with link, 2=Picto only)
* @param string $option Target of link ('', 'customer', 'prospect', 'supplier')
* @param int $maxlen Max length of text
* @param string $notooltip 1=Disable tooltip
* @param integer $notooltip 1=Disable tooltip
* @return string String with URL
*/
function getNomUrl($withpicto=0,$option='',$maxlen=0,$notooltip=0)