Remove calls to deprecated functions (#1005)

* Fix phpcs warning

FILE: ./src/Curl/Curl.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
 239 | WARNING | Function curl_close() is deprecated since PHP 8.5
     |         | (PHPCompatibility.FunctionUse.RemovedFunctions.curl_closeDeprecated)
-----------------------------------------------------------------------------------------------------------------

* Fix phpcs warning

FILE: ./tests/Helper.php
-----------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
 126 | WARNING | Function finfo_close() is deprecated since PHP 8.5
     |         | (PHPCompatibility.FunctionUse.RemovedFunctions.finfo_closeDeprecated)
-----------------------------------------------------------------------------------------------------------------

* Fix psalm error

ERROR: UnusedBaselineEntry - ../src/Curl/Curl.php:0:0 - Baseline for
issue "PossiblyInvalidArgument" has 1 extra entry. (see
https://psalm.dev/316)
This commit is contained in:
Zach Borboa
2025-11-01 23:48:41 -04:00
committed by GitHub
parent 61d27282ac
commit 7e724dc9b8
4 changed files with 0 additions and 6 deletions
-1
View File
@@ -155,7 +155,6 @@ $curl->close();
```php
// Example access to curl object.
curl_set_opt($curl->curl, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1');
curl_close($curl->curl);
```
```php
-3
View File
@@ -235,9 +235,6 @@ class Curl extends BaseCurl
#[\Override]
public function close()
{
if (is_resource($this->curl) || $this->curl instanceof \CurlHandle) {
curl_close($this->curl);
}
$this->curl = null;
$this->options = null;
$this->userSetOptions = null;
-1
View File
@@ -123,7 +123,6 @@ function mime_type($file_path)
{
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$mime_type = finfo_file($finfo, $file_path);
finfo_close($finfo);
return $mime_type;
}
-1
View File
@@ -7,7 +7,6 @@
</ForbiddenCode>
<PossiblyInvalidArgument>
<code><![CDATA[$this->curl]]></code>
<code><![CDATA[$this->curl]]></code>
</PossiblyInvalidArgument>
<PossiblyInvalidOperand>
<code><![CDATA[$const_value]]></code>