Skip to content

Commit c865d35

Browse files
authored
New codestyle && PHP 8.1+ (#15)
1 parent b922e12 commit c865d35

28 files changed

+499
-921
lines changed

.editorconfig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#
2-
# JBZoo Toolbox - Http-Client
2+
# JBZoo Toolbox - Http-Client.
33
#
44
# This file is part of the JBZoo Toolbox project.
55
# For the full copyright and license information, please view the LICENSE
66
# file that was distributed with this source code.
77
#
8-
# @package Http-Client
98
# @license MIT
109
# @copyright Copyright (C) JBZoo.com, All rights reserved.
11-
# @link https://github.com/JBZoo/Http-Client
10+
# @see https://github.com/JBZoo/Http-Client
1211
#
1312

1413
# EditorConfig is awesome: http://EditorConfig.org

.gitattributes

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#
2-
# JBZoo Toolbox - Http-Client
2+
# JBZoo Toolbox - Http-Client.
33
#
44
# This file is part of the JBZoo Toolbox project.
55
# For the full copyright and license information, please view the LICENSE
66
# file that was distributed with this source code.
77
#
8-
# @package Http-Client
98
# @license MIT
109
# @copyright Copyright (C) JBZoo.com, All rights reserved.
11-
# @link https://github.com/JBZoo/Http-Client
10+
# @see https://github.com/JBZoo/Http-Client
1211
#
1312

1413
/.github export-ignore

.github/workflows/main.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#
2-
# JBZoo Toolbox - Http-Client
2+
# JBZoo Toolbox - Http-Client.
33
#
44
# This file is part of the JBZoo Toolbox project.
55
# For the full copyright and license information, please view the LICENSE
66
# file that was distributed with this source code.
77
#
8-
# @package Http-Client
98
# @license MIT
109
# @copyright Copyright (C) JBZoo.com, All rights reserved.
11-
# @link https://github.com/JBZoo/Http-Client
10+
# @see https://github.com/JBZoo/Http-Client
1211
#
1312

1413
name: CI
@@ -21,7 +20,7 @@ on:
2120
branches:
2221
- 'master'
2322
schedule:
24-
- cron: '55 */8 * * *'
23+
- cron: '49 */8 * * *'
2524

2625
env:
2726
COLUMNS: 120
@@ -35,20 +34,22 @@ jobs:
3534
JBZOO_COMPOSER_UPDATE_FLAGS: ${{ matrix.composer_flags }}
3635
strategy:
3736
matrix:
38-
php-version: [ 7.4, 8.0, 8.1 ]
37+
php-version: [ 8.1, 8.2 ]
38+
coverage: [ xdebug, none ]
3939
composer_flags: [ "--prefer-lowest", "" ]
4040
steps:
4141
- name: Checkout code
42-
uses: actions/checkout@v2
42+
uses: actions/checkout@v3
4343
with:
4444
fetch-depth: 0
4545

4646
- name: Setup PHP
4747
uses: shivammathur/setup-php@v2
4848
with:
4949
php-version: ${{ matrix.php-version }}
50-
coverage: xdebug
50+
coverage: ${{ matrix.coverage }}
5151
tools: composer
52+
extensions: ast
5253

5354
- name: Build the Project
5455
run: make update --no-print-directory
@@ -57,12 +58,14 @@ jobs:
5758
run: make test --no-print-directory
5859

5960
- name: Uploading coverage to coveralls
61+
if: ${{ matrix.coverage == 'xdebug' }}
62+
continue-on-error: true
6063
env:
61-
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6265
run: make report-coveralls --no-print-directory || true
6366

6467
- name: Upload Artifacts
65-
uses: actions/upload-artifact@v2
68+
uses: actions/upload-artifact@v3
6669
continue-on-error: true
6770
with:
6871
name: PHPUnit - ${{ matrix.php-version }} - ${{ matrix.coverage }}
@@ -74,17 +77,18 @@ jobs:
7477
runs-on: ubuntu-latest
7578
strategy:
7679
matrix:
77-
php-version: [ 7.4, 8.0, 8.1 ]
80+
php-version: [ 8.1, 8.2 ]
7881
steps:
7982
- name: Checkout code
80-
uses: actions/checkout@v2
83+
uses: actions/checkout@v3
8184
with:
8285
fetch-depth: 0
8386

8487
- name: Setup PHP
8588
uses: shivammathur/setup-php@v2
8689
with:
8790
php-version: ${{ matrix.php-version }}
91+
coverage: none
8892
tools: composer
8993
extensions: ast
9094

@@ -95,7 +99,7 @@ jobs:
9599
run: make codestyle --no-print-directory
96100

97101
- name: Upload Artifacts
98-
uses: actions/upload-artifact@v2
102+
uses: actions/upload-artifact@v3
99103
continue-on-error: true
100104
with:
101105
name: Linters - ${{ matrix.php-version }}
@@ -107,10 +111,10 @@ jobs:
107111
runs-on: ubuntu-latest
108112
strategy:
109113
matrix:
110-
php-version: [ 7.4, 8.0, 8.1 ]
114+
php-version: [ 8.1, 8.2 ]
111115
steps:
112116
- name: Checkout code
113-
uses: actions/checkout@v2
117+
uses: actions/checkout@v3
114118
with:
115119
fetch-depth: 0
116120

@@ -120,6 +124,7 @@ jobs:
120124
php-version: ${{ matrix.php-version }}
121125
coverage: xdebug
122126
tools: composer
127+
extensions: ast
123128

124129
- name: Build the Project
125130
run: make update --no-print-directory
@@ -128,7 +133,7 @@ jobs:
128133
run: make report-all --no-print-directory
129134

130135
- name: Upload Artifacts
131-
uses: actions/upload-artifact@v2
136+
uses: actions/upload-artifact@v3
132137
continue-on-error: true
133138
with:
134139
name: Reports - ${{ matrix.php-version }}

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#
2-
# JBZoo Toolbox - Http-Client
2+
# JBZoo Toolbox - Http-Client.
33
#
44
# This file is part of the JBZoo Toolbox project.
55
# For the full copyright and license information, please view the LICENSE
66
# file that was distributed with this source code.
77
#
8-
# @package Http-Client
98
# @license MIT
109
# @copyright Copyright (C) JBZoo.com, All rights reserved.
11-
# @link https://github.com/JBZoo/Http-Client
10+
# @see https://github.com/JBZoo/Http-Client
1211
#
1312

1413
.idea

.phan.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
11
<?php
22

33
/**
4-
* JBZoo Toolbox - Http-Client
4+
* JBZoo Toolbox - Http-Client.
55
*
66
* This file is part of the JBZoo Toolbox project.
77
* For the full copyright and license information, please view the LICENSE
88
* file that was distributed with this source code.
99
*
10-
* @package Http-Client
1110
* @license MIT
1211
* @copyright Copyright (C) JBZoo.com, All rights reserved.
13-
* @link https://github.com/JBZoo/Http-Client
12+
* @see https://github.com/JBZoo/Http-Client
1413
*/
1514

1615
declare(strict_types=1);
1716

18-
$default = include __DIR__ . '/vendor/jbzoo/codestyle/src/phan/default.php';
17+
$default = include __DIR__ . '/vendor/jbzoo/codestyle/src/phan.php';
1918

20-
return array_merge($default, [
19+
return \array_merge($default, [
2120
'directory_list' => [
2221
'src',
2322

@@ -28,5 +27,5 @@
2827
'vendor/guzzlehttp/promises',
2928
'vendor/psr/http-message',
3029
'vendor/rmccue/requests',
31-
]
30+
],
3231
]);

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#
2-
# JBZoo Toolbox - Http-Client
2+
# JBZoo Toolbox - Http-Client.
33
#
44
# This file is part of the JBZoo Toolbox project.
55
# For the full copyright and license information, please view the LICENSE
66
# file that was distributed with this source code.
77
#
8-
# @package Http-Client
98
# @license MIT
109
# @copyright Copyright (C) JBZoo.com, All rights reserved.
11-
# @link https://github.com/JBZoo/Http-Client
10+
# @see https://github.com/JBZoo/Http-Client
1211
#
1312

1413
ifneq (, $(wildcard ./vendor/jbzoo/codestyle/src/init.Makefile))

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# JBZoo / Http-Client
22

3-
[![Coverage Status](https://coveralls.io/repos/JBZoo/Http-Client/badge.svg)](https://coveralls.io/github/JBZoo/Http-Client) [![Psalm Coverage](https://shepherd.dev/github/JBZoo/Http-Client/coverage.svg)](https://shepherd.dev/github/JBZoo/Http-Client) [![PHP Strict Types](https://img.shields.io/badge/strict__types-%3D1-brightgreen)](https://www.php.net/manual/en/language.types.declarations.php#language.types.declarations.strict)
4-
[![Stable Version](https://poser.pugx.org/jbzoo/http-client/version)](https://packagist.org/packages/jbzoo/http-client) [![Latest Unstable Version](https://poser.pugx.org/jbzoo/http-client/v/unstable)](https://packagist.org/packages/jbzoo/http-client) [![Dependents](https://poser.pugx.org/jbzoo/http-client/dependents)](https://packagist.org/packages/jbzoo/http-client/dependents?order_by=downloads) [![GitHub Issues](https://img.shields.io/github/issues/jbzoo/http-client)](https://github.com/JBZoo/Http-Client/issues) [![Total Downloads](https://poser.pugx.org/jbzoo/http-client/downloads)](https://packagist.org/packages/jbzoo/http-client/stats) [![GitHub License](https://img.shields.io/github/license/jbzoo/http-client)](https://github.com/JBZoo/Http-Client/blob/master/LICENSE)
3+
[![CI](https://github.com/JBZoo/Http-Client/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/JBZoo/Http-Client/actions/workflows/main.yml?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/github/JBZoo/Http-Client/badge.svg?branch=master)](https://coveralls.io/github/JBZoo/Http-Client?branch=master) [![Psalm Coverage](https://shepherd.dev/github/JBZoo/Http-Client/coverage.svg)](https://shepherd.dev/github/JBZoo/Http-Client) [![Psalm Level](https://shepherd.dev/github/JBZoo/Http-Client/level.svg)](https://shepherd.dev/github/JBZoo/Http-Client) [![CodeFactor](https://www.codefactor.io/repository/github/jbzoo/http-client/badge)](https://www.codefactor.io/repository/github/jbzoo/http-client/issues)
4+
[![Stable Version](https://poser.pugx.org/jbzoo/http-client/version)](https://packagist.org/packages/jbzoo/http-client/) [![Total Downloads](https://poser.pugx.org/jbzoo/http-client/downloads)](https://packagist.org/packages/jbzoo/http-client/stats) [![Dependents](https://poser.pugx.org/jbzoo/http-client/dependents)](https://packagist.org/packages/jbzoo/http-client/dependents?order_by=downloads) [![Visitors](https://visitor-badge.glitch.me/badge?page_id=jbzoo.http-client)]() [![GitHub License](https://img.shields.io/github/license/jbzoo/http-client)](https://github.com/JBZoo/Http-Client/blob/master/LICENSE)
55

66

77

composer.json

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,52 +4,60 @@
44
"description" : "Simple HTTP-client, wrapper around Guzzle and rmccue/requests",
55
"license" : "MIT",
66
"keywords" : [
7-
"http", "https", "client", "guzzle", "guzzlehttp", "curl", "request", "requests", "rmccue"
7+
"http",
8+
"https",
9+
"client",
10+
"guzzle",
11+
"guzzlehttp",
12+
"curl",
13+
"request",
14+
"requests",
15+
"rmccue"
816
],
17+
918
"authors" : [
1019
{
1120
"name" : "Denis Smetannikov",
1221
"email" : "[email protected]",
1322
"role" : "lead"
1423
}
1524
],
25+
26+
"minimum-stability" : "dev",
27+
"prefer-stable" : true,
28+
1629
"require" : {
17-
"php" : ">=7.4",
18-
"ext-json" : "*",
30+
"php" : "^8.1",
31+
"ext-json" : "*",
1932

20-
"jbzoo/data" : "7.x-dev",
21-
"jbzoo/utils" : "7.x-dev",
22-
"guzzlehttp/promises" : "^1.4.0"
33+
"jbzoo/data" : "7.x-dev",
34+
"jbzoo/utils" : "7.x-dev",
35+
"jbzoo/event" : "7.x-dev"
2336
},
2437

2538
"require-dev" : {
2639
"jbzoo/toolbox-dev" : "7.x-dev",
27-
"jbzoo/event" : "7.x-dev",
28-
"rmccue/requests" : "^1.7.0",
29-
"guzzlehttp/guzzle" : ">=6.5.5"
40+
"rmccue/requests" : ">=2.0.5",
41+
"guzzlehttp/guzzle" : ">=7.5.0"
3042
},
3143

3244
"suggest" : {
33-
"rmccue/requests" : "Only if you can't use guzzle guzzlehttp/guzzle^6.4",
45+
"rmccue/requests" : "Only if you can't use guzzle guzzlehttp/guzzle^7.5.0",
3446
"guzzlehttp/guzzle" : "Recommended default http-driver",
35-
"jbzoo/event" : ">=3.0"
47+
"jbzoo/event" : "^7.0"
3648
},
3749

3850
"autoload" : {
39-
"psr-4" : {
40-
"JBZoo\\HttpClient\\" : "src"
41-
}
51+
"psr-4" : {"JBZoo\\HttpClient\\" : "src"}
4252
},
4353

44-
"minimum-stability" : "dev",
45-
"prefer-stable" : true,
46-
4754
"autoload-dev" : {
48-
"classmap" : ["tests"]
55+
"psr-4" : {"JBZoo\\PHPUnit\\" : "tests"}
4956
},
5057

5158
"config" : {
52-
"optimize-autoloader" : true
59+
"optimize-autoloader" : true,
60+
"allow-plugins" : {"composer/package-versions-deprecated" : true}
5361
},
5462

5563
"extra" : {

phpunit.xml.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
convertNoticesToExceptions="true"
1818
convertWarningsToExceptions="true"
1919
convertDeprecationsToExceptions="true"
20-
executionOrder="random"
2120
processIsolation="false"
2221
stopOnError="false"
2322
stopOnFailure="false"

src/Driver/AbstractDriver.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
<?php
22

33
/**
4-
* JBZoo Toolbox - Http-Client
4+
* JBZoo Toolbox - Http-Client.
55
*
66
* This file is part of the JBZoo Toolbox project.
77
* For the full copyright and license information, please view the LICENSE
88
* file that was distributed with this source code.
99
*
10-
* @package Http-Client
1110
* @license MIT
1211
* @copyright Copyright (C) JBZoo.com, All rights reserved.
13-
* @link https://github.com/JBZoo/Http-Client
12+
* @see https://github.com/JBZoo/Http-Client
1413
*/
1514

1615
declare(strict_types=1);
@@ -21,19 +20,14 @@
2120
use JBZoo\HttpClient\Response;
2221

2322
/**
24-
* Class AbstractDriver
25-
* @package JBZoo\HttpClient\Driver
23+
* @psalm-consistent-constructor
2624
*/
2725
abstract class AbstractDriver
2826
{
29-
/**
30-
* @param Request $request
31-
* @return Response
32-
*/
3327
abstract public function request(Request $request): Response;
3428

3529
/**
36-
* @param Request[] $requestList
30+
* @param Request[] $requestList
3731
* @return Response[]
3832
*/
3933
abstract public function multiRequest(array $requestList): array;

0 commit comments

Comments
 (0)