Skip to content

Commit b126fd5

Browse files
authored
Merge pull request #376 from j0k3r/fix/2.x-backport-master
Jump to Codecov & Remove Guzzle 5
2 parents 3a14c12 + 79ba357 commit b126fd5

File tree

6 files changed

+10
-107
lines changed

6 files changed

+10
-107
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 5 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,11 @@ jobs:
9090
- name: "Run PHPUnit (with coverage)"
9191
run: "php vendor/bin/simple-phpunit -v --coverage-clover build/logs/clover.xml"
9292

93-
- name: "Retrieve Coveralls phar"
94-
run: "wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.4.2/php-coveralls.phar"
95-
96-
- name: "Enable Coveralls phar"
97-
run: "chmod +x php-coveralls.phar"
98-
99-
- name: "Upload to Coveralls"
100-
run: "php php-coveralls.phar -v -x build/logs/clover.xml"
101-
env:
102-
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93+
- name: Upload coverage to Codecov
94+
uses: codecov/codecov-action@v5
95+
with:
96+
files: ./build/logs/clover.xml
97+
token: ${{ secrets.CODECOV_TOKEN }}
10398

10499
phpunit-lowest:
105100
name: "PHPUnit lowest deps (PHP ${{ matrix.php }})"
@@ -137,45 +132,6 @@ jobs:
137132
- name: "Run PHPUnit"
138133
run: "php vendor/bin/simple-phpunit -v"
139134

140-
phpunit-guzzle5:
141-
name: "PHPUnit (PHP ${{ matrix.php }} and Guzzle 5)"
142-
runs-on: "ubuntu-latest"
143-
144-
strategy:
145-
matrix:
146-
php:
147-
- "7.4"
148-
149-
steps:
150-
- name: "Checkout"
151-
uses: "actions/checkout@v4"
152-
with:
153-
fetch-depth: 2
154-
155-
- name: "Install PHP"
156-
uses: "shivammathur/setup-php@v2"
157-
with:
158-
php-version: "${{ matrix.php }}"
159-
coverage: "none"
160-
tools: composer:v2
161-
extensions: tidy
162-
env:
163-
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
164-
165-
- name: "Install dependencies with Composer"
166-
uses: "ramsey/composer-install@v2"
167-
168-
- name: "Setup adapter: Guzzle 5"
169-
run: |
170-
composer remove guzzlehttp/guzzle php-http/guzzle6-adapter --dev -n
171-
composer require php-http/guzzle5-adapter --dev -n --with-all-dependencies
172-
173-
- name: "Setup logs"
174-
run: "mkdir -p build/logs"
175-
176-
- name: "Run PHPUnit"
177-
run: "php vendor/bin/simple-phpunit -v"
178-
179135
phpunit-guzzle7:
180136
name: "PHPUnit (PHP ${{ matrix.php }} and Guzzle 7)"
181137
runs-on: "ubuntu-latest"
@@ -254,37 +210,3 @@ jobs:
254210

255211
- name: "Run PHPUnit"
256212
run: "php vendor/bin/simple-phpunit -v"
257-
258-
phpunit-composerv1:
259-
name: "PHPUnit Composer v1 (PHP ${{ matrix.php }})"
260-
runs-on: "ubuntu-latest"
261-
262-
strategy:
263-
matrix:
264-
php:
265-
- "7.4"
266-
267-
steps:
268-
- name: "Checkout"
269-
uses: "actions/checkout@v4"
270-
with:
271-
fetch-depth: 2
272-
273-
- name: "Install PHP"
274-
uses: "shivammathur/setup-php@v2"
275-
with:
276-
php-version: "${{ matrix.php }}"
277-
coverage: "none"
278-
tools: composer:v1
279-
extensions: tidy
280-
env:
281-
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
282-
283-
- name: "Install dependencies with Composer"
284-
uses: "ramsey/composer-install@v2"
285-
286-
- name: "Setup logs"
287-
run: "mkdir -p build/logs"
288-
289-
- name: "Run PHPUnit"
290-
run: "php vendor/bin/simple-phpunit -v"

README.md

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
[![Join the chat at https://gitter.im/j0k3r/graby](https://badges.gitter.im/j0k3r/graby.svg)](https://gitter.im/j0k3r/graby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
1111
![CI](https://github.com/j0k3r/graby/workflows/CI/badge.svg)
12-
[![Coverage Status](https://coveralls.io/repos/j0k3r/graby/badge.svg?branch=master&service=github)](https://coveralls.io/github/j0k3r/graby?branch=master)
12+
[![codecov](https://codecov.io/github/j0k3r/graby/branch/2.x/graph/badge.svg?token=yyhZtiTBlc)](https://codecov.io/github/j0k3r/graby)
1313
[![Total Downloads](https://img.shields.io/packagist/dt/j0k3r/graby.svg)](https://packagist.org/packages/j0k3r/graby)
1414
[![License](https://poser.pugx.org/j0k3r/graby/license)](https://packagist.org/packages/j0k3r/graby)
1515
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/j0k3r/graby/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/j0k3r/graby/?branch=master)
@@ -57,7 +57,6 @@ Why `php-http/guzzle6-adapter`? Because Graby is decoupled from any HTTP client
5757
Graby is tested & should work great with:
5858

5959
- Guzzle 6 (using `php-http/guzzle6-adapter`)
60-
- Guzzle 5 (using `php-http/guzzle5-adapter`)
6160
- cURL (using `php-http/curl-client` and a PSR-17 response factory [from this list](https://packagist.org/providers/psr/http-factory-implementation))
6261

6362
### Retrieve content from an url
@@ -198,20 +197,6 @@ $logs = $this->get('monolog.handler.graby')->getRecords();
198197
If you need to define a timeout, you must create the `Http\Client\HttpClient` manually,
199198
configure it and inject it to `Graby\Graby`.
200199

201-
- For Guzzle 5:
202-
203-
```php
204-
use Graby\Graby;
205-
use GuzzleHttp\Client as GuzzleClient;
206-
use Http\Adapter\Guzzle5\Client as GuzzleAdapter;
207-
$guzzle = new GuzzleClient([
208-
'defaults' => [
209-
'timeout' => 2,
210-
]
211-
]);
212-
$graby = new Graby([], new GuzzleAdapter($guzzle));
213-
```
214-
215200
- For Guzzle 6:
216201

217202
```php

UPGRADE-2.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Graby 1 was hardly tied to Guzzle 5.
1212
Graby 2 supports any [HTTP client implementation](https://packagist.org/providers/php-http/client-implementation). It is currently tested against:
1313

1414
- Guzzle 6
15-
- Guzzle 5
15+
- Guzzle 7
1616
- cURL
1717

1818
Here is how to install Graby with Guzzle 6:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"fossar/htmlawed": "^1.2.7",
2222
"http-interop/http-factory-guzzle": "^1.1",
2323
"j0k3r/graby-site-config": "^1.0.181",
24-
"j0k3r/httplug-ssrf-plugin": "^2.0",
24+
"j0k3r/httplug-ssrf-plugin": "^2.0|^3.0",
2525
"j0k3r/php-readability": "^1.2.10",
2626
"monolog/monolog": "^1.18.0|^2.0",
2727
"php-http/client-common": "^2.7",

phpstan.neon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ parameters:
88
- vendor/bin/.phpunit/phpunit-8.5-0/vendor/autoload.php
99

1010
ignoreErrors:
11-
# because we check for some HTTP client to exist or not (Guzzle 5/6 & cURL)
11+
# because we check for some HTTP client to exist or not (Guzzle 6 & cURL)
1212
-
13-
message: '#Http\\Adapter\\Guzzle5\\Client\\|Http\\Adapter\\Guzzle6\\Client\\|Http\\Client\\Curl\\Client given#'
13+
message: '#Http\\Adapter\\Guzzle6\\Client\\|Http\\Client\\Curl\\Client given#'
1414
path: %currentWorkingDirectory%/tests/Extractor/HttpClientTest.php
1515
# we don't want to BC by defining typehint everywhere
1616
# TODO: remove when jumping to 3.0

tests/Extractor/HttpClientTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,6 @@ public function testTimeout(): void
280280
$isGuzzle = true;
281281
$guzzle = new \GuzzleHttp\Client(['timeout' => 2]);
282282
$adapter = new \Http\Adapter\Guzzle6\Client($guzzle);
283-
} elseif (class_exists('Http\Adapter\Guzzle5\Client')) {
284-
$isGuzzle = true;
285-
$guzzle = new \GuzzleHttp\Client(['defaults' => ['timeout' => 2]]);
286-
$adapter = new \Http\Adapter\Guzzle5\Client($guzzle);
287283
} elseif (class_exists('Http\Client\Curl\Client')) {
288284
$isCurl = true;
289285
$adapter = new \Http\Client\Curl\Client(

0 commit comments

Comments
 (0)