Merge pull request #19706 from atm-john/fix_scrutinizer_comments

Fix : scrutinizer comments
This commit is contained in:
Laurent Destailleur 2021-12-30 12:42:08 +01:00 committed by GitHub
commit 706581a227
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 7 deletions

View File

@ -61,6 +61,11 @@ class Validate
$this->outputLang = $outputLang; $this->outputLang = $outputLang;
} }
if (!is_object($this->outputLang) || !method_exists($outputLang, 'load')) {
return false;
}
/** @var Translate $outputLang */
$outputLang->load('validate'); $outputLang->load('validate');
$this->db = $db; $this->db = $db;
@ -212,7 +217,7 @@ class Validate
/** /**
* Check Duration validity * Check Duration validity
* *
* @param string $duration to validate * @param mixed $duration to validate
* @return boolean Validity is ok or not * @return boolean Validity is ok or not
*/ */
public function isDuration($duration) public function isDuration($duration)

View File

@ -388,7 +388,7 @@ function dolRotateImage($file_path)
* Add exif orientation correction for image * Add exif orientation correction for image
* *
* @param string $fileSource Full path to source image to rotate * @param string $fileSource Full path to source image to rotate
* @param string $fileDest string : Full path to image to rotate | false return gd img | null the raw image stream will be outputted directly * @param string|bool $fileDest string : Full path to image to rotate | false return gd img | null the raw image stream will be outputted directly
* @param int $quality output image quality * @param int $quality output image quality
* @return bool : true on success or false on failure or gd img if $fileDest is false. * @return bool : true on success or false on failure or gd img if $fileDest is false.
*/ */
@ -630,7 +630,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small',
} }
// replace image with good orientation // replace image with good orientation
if (!empty($rotated)) { if (!empty($rotated) && isset($trueImgWidth) && isset($trueImgHeight)) {
$img = $rotated; $img = $rotated;
$imgWidth = $trueImgWidth; $imgWidth = $trueImgWidth;
$imgHeight = $trueImgHeight; $imgHeight = $trueImgHeight;

View File

@ -348,8 +348,10 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
*/ */
public $hidden = false; public $hidden = false;
/**
* @var string url to check for module update
*/
public $url_last_version;
/** /**

View File

@ -747,7 +747,7 @@ class Project extends CommonObject
'fk_projet' => $projectkey, 'fk_projet' => $projectkey,
'ids' => $ids, 'ids' => $ids,
); );
$reshook = $hookmanager->executeHooks('getElementList', $parameters, $object, $action); $reshook = $hookmanager->executeHooks('getElementList', $parameters);
if ($reshook > 0) { if ($reshook > 0) {
$sql = $hookmanager->resPrint; $sql = $hookmanager->resPrint;
} else { } else {

View File

@ -101,7 +101,7 @@ if (!empty($conf->global->MAIN_MANIFEST_APPLI_LOGO_URL)) {
$iconPath = $conf->mycompany->dir_output.'/'.$iconRelativePath; $iconPath = $conf->mycompany->dir_output.'/'.$iconRelativePath;
if (is_readable($iconPath)) { if (is_readable($iconPath)) {
$imgSize = getimagesize($iconPath); $imgSize = getimagesize($iconPath);
if ($imgSize) { if (!empty($imgSize)) {
$icon = new stdClass(); $icon = new stdClass();
$icon->src = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode($iconRelativePath); $icon->src = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode($iconRelativePath);
$icon->sizes = $imgSize[0]."x".$imgSize[1]; $icon->sizes = $imgSize[0]."x".$imgSize[1];