2
0
forked from Wavyzz/dolibarr

qual: phpstan (#28075)

* qual: phpstan for htdocs/core/lib/images.lib.php

htdocs/core/lib/images.lib.php	636	Function vignette() should return string but returns int.

* qual: phpstan for htdocs/core/lib/product.lib.php

htdocs/core/lib/product.lib.php	839	Function measuringUnitString() should return string but returns int.

* qual: phpstan for htdocs/core/lib/website.lib.php

htdocs/core/lib/website.lib.php	222	Function dolWebsiteReplacementOfLinks() should return bool but returns string.

* qual: phpstan for htdocs/core/lib/functions.lib.php

htdocs/core/lib/functions.lib.php	9576	Function dol_getIdFromCode() should return int but returns string.

* qual: phpstan for htdocs/core/modules/import/modules_import.php

htdocs/core/modules/import/modules_import.php	173	Method ModeleImports::getDriverId() should return int but returns string.

* qual: phpstan for htdocs/core/modules/mailings/thirdparties_services_expired.modules.php

htdocs/core/modules/mailings/thirdparties_services_expired.modules.php	100	Method mailing_thirdparties_services_expired::add_to_target() should return int but returns string.

* qual:phpstan for htdocs/loan/schedule.php

htdocs/loan/schedule.php	80	Property LoanSchedule::$datec (string) does not accept int.
This commit is contained in:
thibdrev
2024-02-09 11:28:33 +01:00
committed by GitHub
parent dd66a34fe9
commit 0f62b8e7bc
7 changed files with 6 additions and 9 deletions

View File

@@ -9564,7 +9564,7 @@ function dol_osencode($str)
* @param string $fieldid Field to get
* @param int $entityfilter Filter by entity
* @param string $filters Filters to add. WARNING: string must be escaped for SQL and not coming from user input.
* @return int Return integer <0 if KO, Id of code if OK
* @return int|string Return integer <0 if KO, Id of code if OK, '' if empty key provided.
* @see $langs->getLabelFromKey
*/
function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid = 'id', $entityfilter = 0, $filters = '')

View File

@@ -507,7 +507,7 @@ function correctExifImageOrientation($fileSource, $fileDest, $quality = 95)
* @param int $quality Quality of compression (0=worst, 100=best)
* @param string $outdir Directory where to store thumb
* @param int $targetformat New format of target (IMAGETYPE_GIF, IMAGETYPE_JPG, IMAGETYPE_PNG, IMAGETYPE_BMP, IMAGETYPE_WBMP ... or 0 to keep old format)
* @return string Full path of thumb or '' if it fails or 'Error...' if it fails
* @return string|0 Full path of thumb or '' if it fails or 'Error...' if it fails, or 0 if it fails to detect the type of image
*/
function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', $quality = 50, $outdir = 'thumbs', $targetformat = 0)
{

View File

@@ -799,7 +799,7 @@ function measuring_units_string($scale = '', $measuring_style = '', $unit = 0, $
* @param string $scale Scale of unit: '0', '-3', '6', ...
* @param int $use_short_label 1=Use short label ('g' instead of 'gram'). Short labels are not translated.
* @param Translate $outputlangs Language object
* @return string Unit string
* @return string|-1 Unit string if OK, -1 if KO
* @see formproduct->selectMeasuringUnits()
*/
function measuringUnitString($unit, $measuring_style = '', $scale = '', $use_short_label = 0, $outputlangs = null)

View File

@@ -115,7 +115,7 @@ function dolKeepOnlyPhpCode($str)
* @param int $removephppart 0=Replace PHP sections with a PHP badge. 1=Remove completely PHP sections.
* @param string $contenttype Content type
* @param int $containerid Contenair id
* @return boolean True if OK
* @return string html content
* @see dolWebsiteOutput() for function used to replace content in a web server context
*/
function dolWebsiteReplacementOfLinks($website, $content, $removephppart = 0, $contenttype = 'html', $containerid = 0)

View File

@@ -166,7 +166,7 @@ class ModeleImports
/**
* getDriverId
*
* @return int Id
* @return string Code of driver
*/
public function getDriverId()
{

View File

@@ -97,7 +97,7 @@ class mailing_thirdparties_services_expired extends MailingTargets
if ($key == '0') {
$this->error = "Error: You must choose a filter";
$this->errors[] = $this->error;
return $this->error;
return -1;
}
$product = $this->arrayofproducts[$key];

View File

@@ -47,9 +47,6 @@ class LoanSchedule extends CommonObject
public $bank_account;
public $bank_line;
/**
* @var string Create date
*/
public $datec;
public $tms;