Skip to content

Commit

Permalink
Merge pull request #105 from php-mod/3.0
Browse files Browse the repository at this point in the history
Version 3.0
  • Loading branch information
nadar authored Oct 31, 2023
2 parents a8e98b8 + b67d66c commit 54ea806
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 56 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
php: ['8.0', '8.1', '8.2', '8.3']
steps:
## checkout the repoistory
- name: Checkout Repo
Expand Down Expand Up @@ -66,18 +66,18 @@ jobs:
## run unit tests
- name: PHP Unit tests for PHP
run: vendor/bin/phpunit --verbose --configuration actions.phpunit.xml
if: matrix.php == '8.3' || matrix.php == '8.2' || matrix.php == '8.1' || matrix.php == '8.0' || matrix.php == '7.4' || matrix.php == '7.3' || matrix.php == '7.2' || matrix.php == '7.0' || matrix.php == '5.6'
if: matrix.php == '8.3' || matrix.php == '8.2' || matrix.php == '8.1'

## unit test with coverage
- name: PHP Unit tests for PHP 7.1
- name: PHP Unit tests for PHP 8.0
run: vendor/bin/phpunit --verbose --coverage-clover=clover.xml --configuration actions.phpunit.xml
if: matrix.php == '7.1'
if: matrix.php == '8.0'

## coverage
- name: Code coverage
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter after-build -t clover
if: matrix.php == '7.1'
if: matrix.php == '8.0'
continue-on-error: true # if is fork
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).

## 2.6.0
## 3.0.0

> Check the [UPGRADE document](UPGRADE.md) to read more about breaking changes.
+ [#105](https://github.com/php-mod/curl/pull/105) Min PHP version is 8.x, json-extension is required and dropped deprecated methods.


## 2.5.0 (14. December 2022)

Expand Down
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ In order to install this library via composer run the following command in the c
composer require curl/curl
```

or add the package manually to your composer.json file in the require section:

```json
"curl/curl": "^2.0"
```

## Usage examples

A few example for using CURL with get:
Expand Down
7 changes: 7 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This document will help you upgrading from a Version into another.

# 2.x to 3.0

+ Raised minimum PHP version to 8.x
+ Added php `json` extensions are required in composer defintion
+ Removed deprecated methods `_exec()` use `exec()`, `setReferrer()` use `setReferer()` and `verbose()` use `setVerbose()`
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@
}
],
"require": {
"php": "^5.6 | ^7.0 | ^8.0",
"ext-curl": "*"
"php": "^8.0",
"ext-curl": "*",
"ext-json": "*"
},
"require-dev": {
"yoast/phpunit-polyfills": "^0.2.0"
Expand Down
33 changes: 0 additions & 33 deletions src/Curl/Curl.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,16 +282,6 @@ protected function setHttpAuth($httpauth)
$this->setOpt(CURLOPT_HTTPAUTH, $httpauth);
}

// public methods

/**
* @deprecated use `exec()` directly. Will be removed in 3.0
*/
public function _exec()
{
return $this->exec();
}

// functions

/**
Expand Down Expand Up @@ -511,18 +501,6 @@ public function setUserAgent($useragent)
return $this;
}

/**
* @deprecated Call setReferer() instead. Will be removed in 3.0
*
* @param $referrer
* @return self
*/
public function setReferrer($referrer)
{
$this->setReferer($referrer);
return $this;
}

/**
* Set the HTTP referer header.
*
Expand Down Expand Up @@ -617,17 +595,6 @@ public function setVerbose($on = true)
return $this;
}

/**
* @deprecated Call setVerbose() instead. Will be removed in 3.0
*
* @param bool $on
* @return self
*/
public function verbose($on = true)
{
return $this->setVerbose($on);
}

/**
* Reset all curl options.
*
Expand Down
9 changes: 0 additions & 9 deletions tests/CurlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,15 +266,6 @@ public function testReferrer()
)) === 'myreferrer');
}

public function testDeprecatedReferrer()
{
$this->curl->setReferrer('myreferrer');
$this->assertTrue($this->server('GET', array(
'test' => 'server',
'key' => 'HTTP_REFERER',
)) === 'myreferrer');
}

public function testCookies()
{
$this->curl->setCookie('mycookie', 'yum');
Expand Down

0 comments on commit 54ea806

Please sign in to comment.