diff --git a/admin/filemanager/include/php_image_magician.php b/admin/filemanager/include/php_image_magician.php index 0922a7236..f77685090 100644 --- a/admin/filemanager/include/php_image_magician.php +++ b/admin/filemanager/include/php_image_magician.php @@ -1148,8 +1148,6 @@ class imageLib imagecopy($comp, $im, 0, 0, 0, 0, $width, $height); imagecopy($comp, $filter, 0, 0, 0, 0, $width, $height); imagecopymerge($im, $comp, 0, 0, 0, 0, $width, $height, $amount); - - imagedestroy($comp); return $im; } @@ -1261,9 +1259,6 @@ class imageLib } $this->imageResized = $final; - - imagedestroy($li); - imagedestroy($im); } @@ -1571,10 +1566,6 @@ class imageLib imagesavealpha($rgb, true); $this->imageResized = $rgb; - - imagedestroy($image); - imagedestroy($newImage); - imagedestroy($shadow); } @@ -3320,7 +3311,6 @@ class imageLib public function __destruct() { if (is_resource($this->imageResized)) { - imagedestroy($this->imageResized); } } diff --git a/admin/filemanager/include/utils.php b/admin/filemanager/include/utils.php index b8c3295de..8bba34878 100644 --- a/admin/filemanager/include/utils.php +++ b/admin/filemanager/include/utils.php @@ -352,7 +352,6 @@ function get_file_by_url($url) curl_setopt($ch, CURLOPT_URL, $url); $data = curl_exec($ch); - curl_close($ch); return $data; } diff --git a/classes/ImageManager.php b/classes/ImageManager.php index c811fdbcf..d187c02cd 100644 --- a/classes/ImageManager.php +++ b/classes/ImageManager.php @@ -285,7 +285,6 @@ class ImageManagerCore $temp = imagecreatetruecolor($dst_w * $quality + 1, $dst_h * $quality + 1); imagecopyresized($temp, $src_image, 0, 0, $src_x, $src_y, $dst_w * $quality + 1, $dst_h * $quality + 1, $src_w, $src_h); imagecopyresampled($dst_image, $temp, $dst_x, $dst_y, 0, 0, $dst_w, $dst_h, $dst_w * $quality, $dst_h * $quality); - imagedestroy($temp); } else { imagecopyresampled($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); } @@ -321,7 +320,6 @@ class ImageManagerCore $const = defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME; $finfo = finfo_open($const); $mime_type = finfo_file($finfo, $filename); - finfo_close($finfo); } elseif (function_exists('mime_content_type')) { $mime_type = mime_content_type($filename); } elseif (function_exists('exec')) { @@ -542,7 +540,6 @@ class ImageManagerCore $success = imagejpeg($resource, $filename, (int)$quality); break; } - imagedestroy($resource); @chmod($filename, 0664); return $success; } diff --git a/classes/Tag.php b/classes/Tag.php index 92b0434e5..e9f7f1280 100644 --- a/classes/Tag.php +++ b/classes/Tag.php @@ -97,7 +97,7 @@ class TagCore extends ObjectModel } if (!is_array($tag_list)) { - $tag_list = array_filter(array_unique(array_map('trim', preg_split('#\\'.$separator.'#', $tag_list, null, PREG_SPLIT_NO_EMPTY)))); + $tag_list = array_filter(array_unique(array_map('trim', preg_split('#\\'.$separator.'#', $tag_list, 0, PREG_SPLIT_NO_EMPTY)))); } $list = array(); diff --git a/classes/Tools.php b/classes/Tools.php index 2ffec4434..fe499c28d 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -224,7 +224,7 @@ class ToolsCore * * @param string $url Desired URL */ - public static function redirectAdmin($url) + public static function redirectAdmin($url): never { header('Location: '.$url); exit; @@ -1891,13 +1891,13 @@ class ToolsCore } $precision_places = 14 - floor(log10(abs($value))); - $f1 = pow(10.0, (double)abs($places)); + $f1 = pow(10.0, (float) abs($places)); /* If the decimal precision guaranteed by FP arithmetic is higher than * the requested places BUT is small enough to make sure a non-zero value * is returned, pre-round the result to the precision */ if ($precision_places > $places && $precision_places - $places < 15) { - $f2 = pow(10.0, (double)abs($precision_places)); + $f2 = pow(10.0, (float) abs($precision_places)); if ($precision_places >= 0) { $tmp_value = $value * $f2; @@ -1909,7 +1909,7 @@ class ToolsCore * thus never larger than 1e15 here) */ $tmp_value = Tools::round_helper($tmp_value, $mode); /* now correctly move the decimal point */ - $f2 = pow(10.0, (double)abs($places - $precision_places)); + $f2 = pow(10.0, (float) abs($places - $precision_places)); /* because places < precision_places */ $tmp_value = $tmp_value / $f2; } else { @@ -2091,7 +2091,6 @@ class ToolsCore } } $content = curl_exec($curl); - curl_close($curl); return $content; } else { return false; @@ -2965,7 +2964,7 @@ exit; /** * @deprecated as of 1.5 use Controller::getController('PageNotFoundController')->run(); */ - public static function display404Error() + public static function display404Error(): never { header('HTTP/1.1 404 Not Found'); header('Status: 404 Not Found'); diff --git a/classes/webservice/WebserviceSpecificManagementImages.php b/classes/webservice/WebserviceSpecificManagementImages.php index 2a1cff79c..6dc92a3b5 100644 --- a/classes/webservice/WebserviceSpecificManagementImages.php +++ b/classes/webservice/WebserviceSpecificManagementImages.php @@ -1051,7 +1051,6 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage } break; } - imagedestroy($dest_image); if (!$imaged) { throw new WebserviceException(sprintf('Unable to write the image "%s".', str_replace(_PS_ROOT_DIR_, '[SHOP_ROOT_DIR]', $new_path)), array(70, 500)); } @@ -1104,7 +1103,6 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage $const = defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME; $finfo = finfo_open($const); $mime_type = finfo_file($finfo, $file['tmp_name']); - finfo_close($finfo); } elseif (Tools::isCallable('mime_content_type')) { $mime_type = mime_content_type($file['tmp_name']); } elseif (Tools::isCallable('exec')) { diff --git a/composer.json b/composer.json index db48f1054..6b8376dd6 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "source": "https://github.com/Qloapps/QloApps" }, "require": { - "php": ">8.0 <8.5", + "php": ">8.0 <8.6", "ext-curl": "*", "ext-dom": "*", "ext-gd": "*", diff --git a/modules/qloduitkupayment/classes/QdpDuitkuServiceRequest.php b/modules/qloduitkupayment/classes/QdpDuitkuServiceRequest.php index 4e9c94161..19273074b 100644 --- a/modules/qloduitkupayment/classes/QdpDuitkuServiceRequest.php +++ b/modules/qloduitkupayment/classes/QdpDuitkuServiceRequest.php @@ -58,7 +58,6 @@ class QdpDuitkuServiceRequest curl_setopt_array($curl, $options); $request = curl_exec($curl); $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); - curl_close($curl); self::logResponse($request); $response = array(); diff --git a/modules/qlopaypalcommerce/classes/WkPaypalCommerceHelper.php b/modules/qlopaypalcommerce/classes/WkPaypalCommerceHelper.php index cc0ee0129..3e3183872 100644 --- a/modules/qlopaypalcommerce/classes/WkPaypalCommerceHelper.php +++ b/modules/qlopaypalcommerce/classes/WkPaypalCommerceHelper.php @@ -60,8 +60,6 @@ class WkPaypalCommerceHelper $response = curl_exec($curl); $err = curl_error($curl); - curl_close($curl); - if ($err) { throw new PrestaShopException(sprintf('cURL Error #: %s', $err)); } else { @@ -156,7 +154,6 @@ class WkPaypalCommerceHelper $response = curl_exec($curl); $err = curl_error($curl); - curl_close($curl); if ($err) { throw new PrestaShopException(sprintf('cURL Error #: %s', $err)); @@ -215,8 +212,6 @@ class WkPaypalCommerceHelper curl_exec($curl); $err = curl_error($curl); - curl_close($curl); - if ($err) { throw new PrestaShopException(sprintf('cURL Error #: %s', $err)); } @@ -255,8 +250,6 @@ class WkPaypalCommerceHelper $response = curl_exec($curl); $err = curl_error($curl); - curl_close($curl); - if ($err) { throw new PrestaShopException(sprintf('cURL Error #: %s', $err)); } else { diff --git a/modules/qlopaypalcommerce/libs/Helpers/HttpHelper.php b/modules/qlopaypalcommerce/libs/Helpers/HttpHelper.php index f3c42b7ce..b1b75eccb 100644 --- a/modules/qlopaypalcommerce/libs/Helpers/HttpHelper.php +++ b/modules/qlopaypalcommerce/libs/Helpers/HttpHelper.php @@ -30,9 +30,9 @@ class HttpHelper { $this->_initCurl(); } - public function __destruct() { - curl_close($this->_curl); - } + public function __destruct() + { + } private function _initCurl() { if(!function_exists('curl_version')) {