Skip to content

Commit a62755f

Browse files
Merge branch 'php-curl-class:master' into main
2 parents 3378124 + f25353d commit a62755f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+685
-463
lines changed

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@
77
/.editorconfig export-ignore
88
/.gitattributes export-ignore
99
/.gitignore export-ignore
10-
/.pre-commit-config.yaml export-ignore
1110
/TESTING.md export-ignore
1211
/TROUBLESHOOTING.md export-ignore

.github/dependabot.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,36 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "daily"
7+
commit-message:
8+
prefix:
79
versioning-strategy: "increase"
810

911
- package-ecosystem: "github-actions"
1012
directory: "/"
1113
schedule:
1214
interval: "daily"
15+
commit-message:
16+
prefix:
1317
labels:
1418
- "cleanup-no-release-required"
1519
- "dependencies"
1620
- "github_actions"
1721

22+
- package-ecosystem: "npm"
23+
directory: "/www/scripts/"
24+
schedule:
25+
interval: "daily"
26+
commit-message:
27+
prefix:
28+
versioning-strategy: "increase"
29+
1830
- package-ecosystem: "pip"
1931
directory: "/"
2032
schedule:
2133
interval: "daily"
34+
commit-message:
35+
prefix:
2236
versioning-strategy: "increase"
37+
allow:
38+
- dependency-type: "all"
39+
open-pull-requests-limit: 10

.github/workflows/ci.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ jobs:
1515
strategy:
1616
matrix:
1717
php-version:
18-
- '7.4'
1918
- '8.0'
2019
- '8.1'
2120
- '8.2'
@@ -41,13 +40,7 @@ jobs:
4140
persist-credentials: false
4241

4342
- name: Test
44-
run: bash tests/ci.sh
43+
run: bash tests/run.sh
4544
env:
4645
CI_PHP_VERSION: ${{ matrix.php-version }}
4746
CI_PHP_FUTURE_RELEASE: ${{ matrix.future-release }}
48-
49-
- name: Static analysis
50-
run: 'vendor/bin/psalm --config="tests/psalm.xml"'
51-
# TODO: Remove exclusion that skips running psalm on PHP 8.4 when psalm
52-
# supports PHP 8.4 (https://github.com/vimeo/psalm/issues/11107).
53-
if: ${{ !matrix.future-release && matrix.php-version < 8.4 }}

.github/workflows/dependabot-auto-merge.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,44 +13,44 @@ jobs:
1313
steps:
1414
- name: Dependabot metadata
1515
id: dependabot-metadata
16-
uses: dependabot/fetch-metadata@v2.2.0
16+
uses: dependabot/fetch-metadata@v2.4.0
1717

1818
- name: Approve and label updates
1919
run: |
2020
review_status="$(
21-
gh pr view "$PR_URL" \
21+
gh pr view "${PR_URL}" \
2222
--json="reviewDecision" \
2323
--jq=".reviewDecision"
2424
)"
2525
echo "Pull request review status: ${review_status}"
2626
if [[ "${review_status}" != "APPROVED" ]]; then
27-
gh pr review --approve "$PR_URL"
27+
gh pr review --approve "${PR_URL}"
2828
fi
29-
gh pr edit --add-label "cleanup-no-release-required" "$PR_URL"
29+
gh pr edit --add-label "cleanup-no-release-required" "${PR_URL}"
3030
env:
3131
PR_URL: ${{ github.event.pull_request.html_url }}
3232
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3333

3434
- name: Merge Dependabot patch updates
3535
if: ${{ steps.dependabot-metadata.outputs.update-type == 'version-update:semver-patch' }}
3636
run: |
37-
gh pr merge --auto --merge "$PR_URL"
37+
gh pr merge --auto --merge "${PR_URL}"
3838
env:
3939
PR_URL: ${{ github.event.pull_request.html_url }}
4040
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4141

4242
- name: Merge Dependabot minor updates
4343
if: ${{ steps.dependabot-metadata.outputs.update-type == 'version-update:semver-minor' }}
4444
run: |
45-
gh pr merge --auto --merge "$PR_URL"
45+
gh pr merge --auto --merge "${PR_URL}"
4646
env:
4747
PR_URL: ${{ github.event.pull_request.html_url }}
4848
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4949

5050
- name: Merge Dependabot indirect dependency updates
5151
if: ${{ steps.dependabot-metadata.outputs.dependency-type == 'indirect' }}
5252
run: |
53-
gh pr merge --auto --merge "$PR_URL"
53+
gh pr merge --auto --merge "${PR_URL}"
5454
env:
5555
PR_URL: ${{ github.event.pull_request.html_url }}
5656
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
- name: Get changed python files
1616
id: changed-files
17-
uses: tj-actions/changed-files@v45
17+
uses: tj-actions/changed-files@v46
1818
with:
1919
files: "**/*.py"
2020

@@ -30,7 +30,7 @@ jobs:
3030
- name: flake8 changed files
3131
if: steps.changed-files.outputs.any_changed == 'true'
3232
run: |
33-
flake8 ${{ steps.changed-files.outputs.all_changed_files }}
33+
flake8 --config="tests/setup.cfg" ${{ steps.changed-files.outputs.all_changed_files }}
3434
3535
- name: isort changed files
3636
if: steps.changed-files.outputs.any_changed == 'true'

.github/workflows/outdated.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Track outdated dependencies
2+
3+
on:
4+
schedule:
5+
- cron: '0 18 * * 1-4'
6+
workflow_dispatch:
7+
8+
jobs:
9+
run:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
with:
15+
persist-credentials: false
16+
17+
- name: Gather requirements
18+
id: check-outdated
19+
run: |
20+
python -m venv venv
21+
source venv/bin/activate
22+
python -m pip install --upgrade pip
23+
pip install --requirement scripts/make_release_requirements.txt
24+
outdated="$(pip list --outdated --format json | jq)"
25+
outdated_count="$(echo "$outdated" | jq 'length')"
26+
echo "${outdated}" | jq "[{\"outdated_count\":\"${outdated_count}\"}] + ." > scripts/make_release_requirements.json
27+
git diff --color
28+
changes="$(git diff)"
29+
delimiter="$(openssl rand -hex 8)"
30+
echo "changes<<${delimiter}" >> "${GITHUB_OUTPUT}"
31+
echo "${changes}" >> "${GITHUB_OUTPUT}"
32+
echo "${delimiter}" >> "${GITHUB_OUTPUT}"
33+
34+
- name: Create or update pull request
35+
id: cpr
36+
uses: peter-evans/create-pull-request@v7
37+
with:
38+
commit-message: Update outdated dependencies list
39+
labels: cleanup-no-release-required, dependencies, github_actions
40+
title: ⬆ Update outdated dependencies list
41+
body: |
42+
```diff
43+
${{ steps.check-outdated.outputs.changes }}
44+
```
45+
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
46+
branch: create-pull-request/outdated
47+
committer: GitHub <noreply@github.com>
48+
delete-branch: true
49+
token: ${{ secrets.PHP_CURL_CLASS_BOT_TOKEN }}
50+
push-to-fork: php-curl-class-helper/php-curl-class
51+
env:
52+
GITHUB_TOKEN: ${{ secrets.PHP_CURL_CLASS_BOT_TOKEN }}
53+
54+
- name: Pull request created or updated
55+
if: ${{ steps.cpr.outputs.pull-request-number }}
56+
run: |
57+
echo "Pull request: ${{ steps.cpr.outputs.pull-request-url }}"
58+
59+
- name: Approve outdated dependencies pull request
60+
if: ${{ steps.cpr.outputs.pull-request-number }}
61+
run: |
62+
review_status="$(
63+
gh pr view "${PR_URL}" \
64+
--json="reviewDecision" \
65+
--jq=".reviewDecision"
66+
)"
67+
echo "Pull request review status: ${review_status}"
68+
if [[ "${review_status}" != "APPROVED" ]]; then
69+
gh pr review --approve "${PR_URL}"
70+
fi
71+
env:
72+
PR_URL: ${{ steps.cpr.outputs.pull-request-url }}
73+
GITHUB_TOKEN: ${{ secrets.PHP_CURL_CLASS_TOKEN }}
74+
75+
- name: Enable auto-merge for outdated dependencies pull request
76+
if: ${{ steps.cpr.outputs.pull-request-number }}
77+
run: |
78+
gh pr merge --auto --merge "${PR_URL}"
79+
env:
80+
PR_URL: ${{ steps.cpr.outputs.pull-request-url }}
81+
GITHUB_TOKEN: ${{ secrets.PHP_CURL_CLASS_TOKEN }}

.github/workflows/pre-commit-auto-update.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
set -x
2121
python -m pip install --upgrade pip
2222
pip install pre-commit
23-
pre-commit autoupdate
23+
pre-commit autoupdate --config="tests/.pre-commit-config.yaml"
2424
2525
- name: Gather changes
2626
id: gather-changes
@@ -38,12 +38,13 @@ jobs:
3838
with:
3939
commit-message: Update pre-commit dependencies
4040
labels: cleanup-no-release-required, dependencies, github_actions
41-
title: Update pre-commit dependencies
41+
title: Update pre-commit dependencies
4242
body: |
4343
```diff
4444
${{ steps.gather-changes.outputs.changes }}
4545
```
4646
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
47+
branch: create-pull-request/pre-commit
4748
committer: GitHub <noreply@github.com>
4849
delete-branch: true
4950
token: ${{ secrets.PHP_CURL_CLASS_BOT_TOKEN }}
@@ -62,21 +63,23 @@ jobs:
6263
set -x
6364
gh repo set-default php-curl-class/php-curl-class
6465
gh repo set-default --view
65-
gh pr merge --auto --merge "${{ steps.cpr.outputs.pull-request-url }}"
66+
gh pr merge --auto --merge "${PR_URL}"
6667
env:
68+
PR_URL: ${{ steps.cpr.outputs.pull-request-url }}
6769
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6870

6971
- name: Approve update
7072
if: ${{ steps.cpr.outputs.pull-request-number }}
7173
run: |
7274
review_status="$(
73-
gh pr view "${{ steps.cpr.outputs.pull-request-url }}" \
75+
gh pr view "${PR_URL}" \
7476
--json="reviewDecision" \
7577
--jq=".reviewDecision"
7678
)"
7779
echo "Pull request review status: ${review_status}"
7880
if [[ "${review_status}" != "APPROVED" ]]; then
79-
gh pr review --approve "${{ steps.cpr.outputs.pull-request-url }}"
81+
gh pr review --approve "${PR_URL}"
8082
fi
8183
env:
84+
PR_URL: ${{ steps.cpr.outputs.pull-request-url }}
8285
GITHUB_TOKEN: ${{ secrets.PHP_CURL_CLASS_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
vendor/
2+
venv/
23
composer.lock
34

45
.idea/

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,35 @@ backwards-incompatible changes that will affect existing usage.
66

77
<!-- CHANGELOG_PLACEHOLDER -->
88

9+
## 12.0.0 - 2025-03-25
10+
11+
- Drop support for PHP 7.4 ([#937](https://github.com/php-curl-class/php-curl-class/pull/937))
12+
13+
## 11.1.0 - 2025-03-24
14+
15+
- Add methods like Curl::setGet() for each HTTP request method ([#936](https://github.com/php-curl-class/php-curl-class/pull/936))
16+
17+
## 11.0.5 - 2025-03-11
18+
19+
- Fix PHPStan static analysis errors ([#929](https://github.com/php-curl-class/php-curl-class/pull/929))
20+
21+
## 11.0.4 - 2025-02-20
22+
23+
- Increase psalm strictness ([#925](https://github.com/php-curl-class/php-curl-class/pull/925))
24+
25+
## 11.0.3 - 2025-02-19
26+
27+
- Use default for Psalm ensureOverrideAttribute ([#923](https://github.com/php-curl-class/php-curl-class/pull/923))
28+
29+
## 11.0.2 - 2025-02-18
30+
31+
- Fix CI (PHPUnit) ([#918](https://github.com/php-curl-class/php-curl-class/pull/918))
32+
33+
## 11.0.1 - 2025-01-13
34+
35+
- Increase Psalm strictness ([#909](https://github.com/php-curl-class/php-curl-class/pull/909))
36+
- Increase PHPStan strictness ([#908](https://github.com/php-curl-class/php-curl-class/pull/908))
37+
938
## 11.0.0 - 2024-08-22
1039

1140
- Drop support for PHP 7.3 ([#889](https://github.com/php-curl-class/php-curl-class/pull/889))

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[![](https://img.shields.io/github/license/php-curl-class/php-curl-class.svg?style=for-the-badge)](https://github.com/php-curl-class/php-curl-class/blob/master/LICENSE)
55
[![](https://img.shields.io/github/actions/workflow/status/php-curl-class/php-curl-class/ci.yml?style=for-the-badge&label=build&branch=master)](https://github.com/php-curl-class/php-curl-class/actions/workflows/ci.yml)
66
[![](https://img.shields.io/github/actions/workflow/status/php-curl-class/php-curl-class/release.yml?style=for-the-badge&label=release&branch=master)](https://github.com/php-curl-class/php-curl-class/releases/)
7+
[![](https://img.shields.io/github/actions/workflow/status/php-curl-class/php-curl-class/dependabot/dependabot-updates?style=for-the-badge&label=Dependabot&branch=master)](https://github.com/php-curl-class/php-curl-class/actions/workflows/dependabot/dependabot-updates)
78
[![](https://img.shields.io/packagist/dt/php-curl-class/php-curl-class.svg?style=for-the-badge)](https://github.com/php-curl-class/php-curl-class/releases/)
89

910
PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs.
@@ -37,7 +38,7 @@ Installation instructions to use the `composer` command can be found on https://
3738

3839
### 📋 Requirements
3940

40-
PHP Curl Class works with PHP 8.4, 8.3, 8.2, 8.1, 8.0, and 7.4.
41+
PHP Curl Class works with PHP 8.4, 8.3, 8.2, 8.1, and 8.0.
4142

4243
### 🚀 Quick Start and Examples
4344

@@ -199,6 +200,7 @@ More examples are available under [/examples](https://github.com/php-curl-class/
199200
Curl::__construct($base_url = null, $options = [])
200201
Curl::__destruct()
201202
Curl::__get($name)
203+
Curl::__isset($name)
202204
Curl::afterSend($callback)
203205
Curl::attemptRetry()
204206
Curl::beforeSend($callback)
@@ -278,29 +280,37 @@ Curl::setDefaultJsonDecoder()
278280
Curl::setDefaultTimeout()
279281
Curl::setDefaultUserAgent()
280282
Curl::setDefaultXmlDecoder()
283+
Curl::setDelete($url, $query_parameters = [], $data = [])
281284
Curl::setDigestAuthentication($username, $password = '')
282285
Curl::setFile($file)
283286
Curl::setFollowLocation($follow_location = true)
284287
Curl::setForbidReuse($forbid_reuse = true)
288+
Curl::setGet($url, $data = [])
289+
Curl::setHead($url, $data = [])
285290
Curl::setHeader($key, $value)
286291
Curl::setHeaders($headers)
287292
Curl::setInterface($interface)
288293
Curl::setJsonDecoder($mixed)
289294
Curl::setMaxFilesize($bytes)
290295
Curl::setMaximumRedirects($maximum_redirects)
291296
Curl::setOpt($option, $value)
297+
Curl::setOptions($url, $data = [])
292298
Curl::setOpts($options)
299+
Curl::setPatch($url, $data = [])
293300
Curl::setPort($port)
301+
Curl::setPost($url, $data = '', $follow_303_with_post = false)
294302
Curl::setProtocols($protocols)
295303
Curl::setProxy($proxy, $port = null, $username = null, $password = null)
296304
Curl::setProxyAuth($auth)
297305
Curl::setProxyTunnel($tunnel = true)
298306
Curl::setProxyType($type)
307+
Curl::setPut($url, $data = [])
299308
Curl::setRange($range)
300309
Curl::setRedirectProtocols($redirect_protocols)
301310
Curl::setReferer($referer)
302311
Curl::setReferrer($referrer)
303312
Curl::setRetry($mixed)
313+
Curl::setSearch($url, $data = [])
304314
Curl::setStop($callback = null)
305315
Curl::setTimeout($seconds)
306316
Curl::setUrl($url, $mixed_data = '')

0 commit comments

Comments
 (0)