Skip to content

Commit c9e64f9

Browse files
authored
Merge pull request #4 from superbrave/DV-8390
[DV-8390] Made package PHP ^8.2 and Symfony ^6.4|^7.0 compatible.
2 parents b5a26c2 + 9aba54c commit c9e64f9

21 files changed

+357
-3443
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
on:
2+
pull_request:
3+
types:
4+
- opened
5+
- synchronize
6+
- reopened
7+
branches:
8+
- '*'
9+
10+
jobs:
11+
qa:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v2
17+
18+
- name: Setup PHP
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: '8.2'
22+
23+
- name: Install dependencies
24+
run: composer install --prefer-dist --no-progress
25+
26+
- name: Run tests
27+
run: composer test
28+
29+
- name: Check PHPCS
30+
run: composer check-code-style
31+
32+
- name: Check PHPStan
33+
run: composer check-phpstan

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/vendor/
22
*.cache
3+
composer.lock

.php-cs-fixer.dist.php

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use PhpCsFixer\Config;
6+
use PhpCsFixer\Finder;
7+
8+
$finder = Finder::create()
9+
->in(__DIR__)
10+
->exclude([
11+
'vendor',
12+
]);
13+
14+
return (new Config())
15+
->setRules([
16+
'@Symfony' => true,
17+
'@PSR12' => true,
18+
'array_syntax' => [
19+
'syntax' => 'short',
20+
],
21+
'phpdoc_to_comment' => false,
22+
'declare_strict_types' => true,
23+
'global_namespace_import' => [
24+
'import_classes' => true,
25+
],
26+
'phpdoc_separation' => false,
27+
'phpdoc_align' => false,
28+
'multiline_whitespace_before_semicolons' => true,
29+
'trailing_comma_in_multiline' => [
30+
'elements' => [
31+
'arrays',
32+
'parameters',
33+
'match',
34+
],
35+
],
36+
'no_unused_imports' => true,
37+
'ordered_class_elements' => [
38+
'order' => [
39+
'use_trait',
40+
'constant_public',
41+
'constant_protected',
42+
'constant_private',
43+
'case',
44+
'property',
45+
'construct',
46+
'destruct',
47+
'magic',
48+
'phpunit',
49+
'method_public',
50+
'method_protected',
51+
'method_private',
52+
],
53+
],
54+
'ordered_imports' => true,
55+
'yoda_style' => false,
56+
'nullable_type_declaration_for_default_null_value' => false,
57+
])
58+
->setFinder($finder);

.php_cs.dist

Lines changed: 0 additions & 13 deletions
This file was deleted.

.scrutinizer.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,26 @@
1-
# Verbose error HTTP client
1+
# Verbose error HTTP client bundle
22

33
[![Latest version on Packagist][ico-version]][link-version]
44
[![Software License][ico-license]][link-license]
5-
[![Build Status][ico-build]][link-build]
6-
[![Coverage Status][ico-coverage]][link-coverage]
7-
[![Code Quality][ico-code-quality]][link-code-quality]
85

96
Increased verbosity of error messages in the Symfony HTTP client.
107

118
## Installation using Composer
129
Run the following command to add the package to the composer.json of your project:
1310

1411
``` bash
15-
$ composer require superbrave/verbose-error-http-client symfony/http-client
12+
$ composer require superbrave/verbose-error-http-client-bundle symfony/http-client
1613
```
1714

1815
The `symfony/http-client` can be replaced with any other HTTP client implementing the Symfony HTTP client contracts.
1916

2017
## Usage
2118
The following example shows how to create the instances required execute requests with verbose exception messages:
19+
2220
```php
2321
<?php
2422

25-
use Superbrave\VerboseErrorHttpClient\VerboseErrorHttpClient;
26-
use Symfony\Component\HttpClient\HttpClient;
23+
use Superbrave\VerboseErrorHttpClient\HttpClient\VerboseErrorHttpClient;use Symfony\Component\HttpClient\HttpClient;
2724

2825
$httpClient = HttpClient::create();
2926
$verboseErrorHttpClient = new VerboseErrorHttpClient($httpClient);
@@ -32,17 +29,10 @@ $response = $verboseErrorHttpClient->request('GET', 'https://superbrave.nl/api')
3229
```
3330

3431
## License
35-
The Verbose error HTTP client is licensed under the MIT License. Please see the [LICENSE file][link-license]
36-
for details.
32+
The Verbose error HTTP client is licensed under the MIT License. Please see the [LICENSE file][link-license] for details.
3733

3834
[ico-version]: https://img.shields.io/packagist/v/superbrave/verbose-error-http-client
3935
[ico-license]: https://img.shields.io/packagist/l/superbrave/verbose-error-http-client
40-
[ico-build]: https://scrutinizer-ci.com/g/superbrave/verbose-error-http-client/badges/build.png?b=master
41-
[ico-coverage]: https://scrutinizer-ci.com/g/superbrave/verbose-error-http-client/badges/coverage.png?b=master
42-
[ico-code-quality]: https://scrutinizer-ci.com/g/superbrave/verbose-error-http-client/badges/quality-score.png?b=master
4336

4437
[link-version]: https://packagist.org/packages/superbrave/verbose-error-http-client
4538
[link-license]: LICENSE
46-
[link-build]: https://scrutinizer-ci.com/g/superbrave/verbose-error-http-client/build-status/master
47-
[link-coverage]: https://scrutinizer-ci.com/g/superbrave/verbose-error-http-client/build-status/master
48-
[link-code-quality]: https://scrutinizer-ci.com/g/superbrave/verbose-error-http-client/build-status/master

composer.json

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "superbrave/verbose-error-http-client",
2+
"name": "superbrave/verbose-error-http-client-bundle",
33
"description": "Increased verbosity of error messages in the Symfony HTTP client.",
4-
"type": "library",
4+
"type": "symfony-bundle",
55
"license": "MIT",
66
"authors": [
77
{
@@ -10,13 +10,17 @@
1010
}
1111
],
1212
"require": {
13-
"php": "^7.2",
14-
"symfony/http-client-contracts": "^1.1 || ^2.0"
13+
"php": "^8.2",
14+
"symfony/http-client-contracts": "^3.4",
15+
"symfony/dependency-injection": "^6.4|^7.0",
16+
"symfony/framework-bundle": "^6.4|^7.0"
1517
},
1618
"require-dev": {
17-
"friendsofphp/php-cs-fixer": "^2.15",
18-
"phpunit/phpunit": "^8.3",
19-
"symfony/http-client": "^4.4 || ^5.1"
19+
"roave/security-advisories": "dev-latest",
20+
"friendsofphp/php-cs-fixer": "^3.54",
21+
"phpstan/phpstan": "^1.10",
22+
"phpunit/phpunit": "^9.6",
23+
"symfony/http-client": "^6.4|^7.0"
2024
},
2125
"suggest": {
2226
"symfony/http-client": "This package requires an actual Symfony HTTP client implementation to decorate."
@@ -26,15 +30,21 @@
2630
},
2731
"autoload": {
2832
"psr-4": {
29-
"Superbrave\\VerboseErrorHttpClient\\": "src/"
33+
"Superbrave\\VerboseErrorHttpClientBundle\\": "src/"
3034
}
3135
},
3236
"autoload-dev": {
3337
"psr-4": {
34-
"Superbrave\\VerboseErrorHttpClient\\Tests\\": "tests/"
38+
"Superbrave\\VerboseErrorHttpClientBundle\\Tests\\": "tests/"
3539
}
3640
},
3741
"config": {
3842
"sort-packages": true
43+
},
44+
"scripts": {
45+
"check-phpstan": "vendor/bin/phpstan analyse",
46+
"check-code-style": "vendor/bin/php-cs-fixer fix --allow-risky=yes --dry-run -v",
47+
"fix-code-style": "vendor/bin/php-cs-fixer fix --allow-risky=yes",
48+
"test": "phpunit"
3949
}
4050
}

0 commit comments

Comments
 (0)