From e944fbbd0fef5fbbef4109839a98b9004e029fa7 Mon Sep 17 00:00:00 2001 From: Mohamed DAOUD Date: Tue, 25 Feb 2025 19:12:26 +0100 Subject: [PATCH] fix phan --- htdocs/admin/modules.php | 8 +++--- .../class/externalModules.class.php | 27 +++++++++++-------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 83b7e7f8db8..3ee3e026912 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -126,10 +126,10 @@ if (!GETPOST('buttonreset', 'alpha')) { $param .= '&search_keyword='.urlencode($search_keyword); } if ($search_source_dolistore) { - $param .= '&search_source_dolistore='.urlencode($search_source_dolistore); + $param .= '&search_source_dolistore='.$search_source_dolistore; } if ($search_source_github) { - $param .= '&search_source_github='.urlencode($search_source_github); + $param .= '&search_source_github='.$search_source_github; } if ($search_status && $search_status != '-1') { $param .= '&search_status='.urlencode($search_status); @@ -190,8 +190,8 @@ if (GETPOST('buttonreset', 'alpha')) { $search_status = ''; $search_nature = ''; $search_version = ''; - $search_source_dolistore = ''; - $search_source_github = ''; + $search_source_dolistore = 0; + $search_source_github = 0; } if ($action == 'install' && $allowonlineinstall) { diff --git a/htdocs/admin/remotestore/class/externalModules.class.php b/htdocs/admin/remotestore/class/externalModules.class.php index 993df272ba1..8a8f7228833 100644 --- a/htdocs/admin/remotestore/class/externalModules.class.php +++ b/htdocs/admin/remotestore/class/externalModules.class.php @@ -57,7 +57,11 @@ class ExternalModules */ public $cache_file; - public $url; // the url of this page + /** + * // the url of this page + * @var string + */ + public $url; /** * @var string */ @@ -100,7 +104,7 @@ class ExternalModules public $numberOfProviders; /** - * @var array|null + * @var array */ public $products; @@ -179,8 +183,8 @@ class ExternalModules curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HTTPHEADER, $httpheader); curl_setopt($curl, CURLOPT_HEADER, true); - curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); $response = curl_exec($curl); @@ -343,7 +347,7 @@ class ExternalModules // add image or default ? if ($product["cover_photo_url"] != '') { $images = 'trans('Version').' '.$product["module_version"]).'">'; - $images .= ''; + $images .= ''; } else { $images = ''; } @@ -614,8 +618,8 @@ class ExternalModules /** * get YAML file from remote source and put it in cache file for one day - * @param string $file_source_url URL of the remote source - * @param string $cache_time Cache time + * @param string $file_source_url URL of the remote source + * @param int $cache_time Cache time * * @return string Uri of the cache file */ @@ -642,7 +646,8 @@ class ExternalModules /** * Read a YAML string and convert it to an array * @param string $yaml YAML string - * @return array Parsed array representation + * + * @return array Parsed array representation */ public function readYaml($yaml) { @@ -708,7 +713,7 @@ class ExternalModules * @param array $data Data fetched from github remote source * @param string $source Source of the data * - * @return array Data adapted to the expected format + * @return list> Data adapted to the expected format */ public function adaptData($data, $source) { @@ -793,7 +798,7 @@ class ExternalModules * @param array $data Data to filter * @param array $options Options for the filter * - * @return array Filtered data + * @return list> Filtered data */ public function applyFilters($data, $options) { @@ -826,7 +831,7 @@ class ExternalModules /** * Check if an Dolistore API is up * - * @return bool + * @return int */ public function checkApiStatus() {