Skip to content

Commit 59a3d1c

Browse files
authored
Replace Async functionality (#100)
* wip: phpgt/promise implementation for #89 * wip: refactor to gt promise model still need to handle rejection exceptions * feature: add badly formed json for testing * ci: update workflows * build: update dependencies * docs: update example to match new functionality * wip: sign off Http class * wip: use master branch of async * wip: fix existing tests * feature: implement proper blob response type * wip: tidy request resolver * wip: tidy curl opt builder * wip: tidy http class * stan: improve static analysis over core classes * test: improve types for native curl handle * stan: remove unused import * wip: document BodyResponse internal rejection * wip: remove alternative method of throwing internal exception * docs: update examples
1 parent 3b7c868 commit 59a3d1c

24 files changed

+794
-1110
lines changed

.github/workflows/ci.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ jobs:
77
runs-on: ubuntu-latest
88

99
steps:
10-
- uses: actions/checkout@v2
10+
- uses: actions/checkout@v3
1111

1212
- name: Cache Composer dependencies
13-
uses: actions/cache@v2
13+
uses: actions/cache@v3
1414
with:
1515
path: /tmp/composer-cache
1616
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
1717

18-
- uses: php-actions/composer@v5
18+
- uses: php-actions/composer@v6
1919

2020
- name: Archive build
2121
run: mkdir /tmp/github-actions/ && tar -cvf /tmp/github-actions/build.tar ./
2222

2323
- name: Upload build archive for test runners
24-
uses: actions/upload-artifact@v2
24+
uses: actions/upload-artifact@v3
2525
with:
2626
name: build-artifact
2727
path: /tmp/github-actions
@@ -31,7 +31,7 @@ jobs:
3131
needs: [composer]
3232

3333
steps:
34-
- uses: actions/download-artifact@v2
34+
- uses: actions/download-artifact@v3
3535
with:
3636
name: build-artifact
3737
path: /tmp/github-actions
@@ -40,9 +40,9 @@ jobs:
4040
run: tar -xvf /tmp/github-actions/build.tar ./
4141

4242
- name: PHP Unit tests
43-
uses: php-actions/phpunit@v2
43+
uses: php-actions/phpunit@v3
4444
with:
45-
php_version: 8.0
45+
php_version: 8.1
4646
php_extensions: xdebug
4747
configuration: test/phpunit/phpunit.xml
4848
bootstrap: vendor/autoload.php
@@ -52,7 +52,7 @@ jobs:
5252
needs: [composer]
5353

5454
steps:
55-
- uses: actions/download-artifact@v2
55+
- uses: actions/download-artifact@v3
5656
with:
5757
name: build-artifact
5858
path: /tmp/github-actions
@@ -61,6 +61,6 @@ jobs:
6161
run: tar -xvf /tmp/github-actions/build.tar ./
6262

6363
- name: PHP Static Analysis
64-
uses: php-actions/phpstan@v2
64+
uses: php-actions/phpstan@v3
6565
with:
66-
path: src/
66+
path: src/

.scrutinizer.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
build:
22
environment:
3-
php: 8.0.0
3+
php: 8.1.0
44

55
nodes:
66
analysis:
@@ -29,4 +29,4 @@ checks:
2929
filter:
3030
excluded_paths:
3131
- test/*
32-
- vendor/*
32+
- vendor/*

broken.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "Some broken JSON",
3+
"description" "This JSON is not correctly formed";
4+
}

composer.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
},
1111

1212
"require": {
13-
"php": ">=7.2",
13+
"php": ">=8.1",
1414
"ext-curl": "*",
1515
"ext-json": "*",
16-
"phpgt/http": "*",
17-
"phpgt/curl": "*",
18-
19-
"php-http/httplug": "^2.0",
20-
"react/promise": "2.*",
21-
"react/event-loop": "^1.0"
16+
"phpgt/async": "dev-master",
17+
"phpgt/promise": "dev-master as v2.0.0",
18+
"phpgt/http": "^v1.1",
19+
"phpgt/curl": "^v3.0",
20+
"phpgt/json": "^v1.1",
21+
"php-http/httplug": "^2.3"
2222
},
2323

2424
"require-dev": {

0 commit comments

Comments
 (0)