mirror of
https://github.com/php-curl-class/php-curl-class.git
synced 2026-09-05 07:16:27 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
</ForbiddenCode>
|
||||
<PossiblyInvalidArgument>
|
||||
<code><![CDATA[$this->curl]]></code>
|
||||
<code><![CDATA[$this->curl]]></code>
|
||||
</PossiblyInvalidArgument>
|
||||
<PossiblyInvalidOperand>
|
||||
<code><![CDATA[$const_value]]></code>
|
||||
|
||||
Reference in New Issue
Block a user