Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DV-8390] Made package PHP ^8.2 and Symfony ^6.4|^7.0 compatible. #4

Merged
merged 6 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/quality-assurance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
on:
pull_request:
types:
- opened
- synchronize
- reopened
branches:
- '*'

jobs:
qa:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run tests
run: composer test

- name: Check PHPCS
run: composer check-code-style

- name: Check PHPStan
run: composer check-phpstan
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/vendor/
*.cache
composer.lock
58 changes: 58 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php

declare(strict_types=1);

use PhpCsFixer\Config;
use PhpCsFixer\Finder;

$finder = Finder::create()
->in(__DIR__)
->exclude([
'vendor',
]);

return (new Config())
kkevindev marked this conversation as resolved.
Show resolved Hide resolved
->setRules([
'@Symfony' => true,
'@PSR12' => true,
'array_syntax' => [
'syntax' => 'short',
],
'phpdoc_to_comment' => false,
'declare_strict_types' => true,
'global_namespace_import' => [
'import_classes' => true,
],
'phpdoc_separation' => false,
'phpdoc_align' => false,
'multiline_whitespace_before_semicolons' => true,
'trailing_comma_in_multiline' => [
'elements' => [
'arrays',
'parameters',
'match',
],
],
'no_unused_imports' => true,
'ordered_class_elements' => [
'order' => [
'use_trait',
'constant_public',
'constant_protected',
'constant_private',
'case',
'property',
'construct',
'destruct',
'magic',
'phpunit',
'method_public',
'method_protected',
'method_private',
],
],
'ordered_imports' => true,
'yoda_style' => false,
'nullable_type_declaration_for_default_null_value' => false,
])
->setFinder($finder);
13 changes: 0 additions & 13 deletions .php_cs.dist

This file was deleted.

57 changes: 0 additions & 57 deletions .scrutinizer.yml

This file was deleted.

20 changes: 5 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
# Verbose error HTTP client
# Verbose error HTTP client bundle

[![Latest version on Packagist][ico-version]][link-version]
[![Software License][ico-license]][link-license]
[![Build Status][ico-build]][link-build]
[![Coverage Status][ico-coverage]][link-coverage]
[![Code Quality][ico-code-quality]][link-code-quality]

Increased verbosity of error messages in the Symfony HTTP client.

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

``` bash
$ composer require superbrave/verbose-error-http-client symfony/http-client
$ composer require superbrave/verbose-error-http-client-bundle symfony/http-client
```

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

## Usage
The following example shows how to create the instances required execute requests with verbose exception messages:

```php
<?php

use Superbrave\VerboseErrorHttpClient\VerboseErrorHttpClient;
use Symfony\Component\HttpClient\HttpClient;
use Superbrave\VerboseErrorHttpClient\HttpClient\VerboseErrorHttpClient;use Symfony\Component\HttpClient\HttpClient;

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

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

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

[link-version]: https://packagist.org/packages/superbrave/verbose-error-http-client
[link-license]: LICENSE
[link-build]: https://scrutinizer-ci.com/g/superbrave/verbose-error-http-client/build-status/master
[link-coverage]: https://scrutinizer-ci.com/g/superbrave/verbose-error-http-client/build-status/master
[link-code-quality]: https://scrutinizer-ci.com/g/superbrave/verbose-error-http-client/build-status/master
28 changes: 19 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "superbrave/verbose-error-http-client",
"name": "superbrave/verbose-error-http-client-bundle",
"description": "Increased verbosity of error messages in the Symfony HTTP client.",
"type": "library",
"type": "symfony-bundle",
"license": "MIT",
"authors": [
{
Expand All @@ -10,13 +10,17 @@
}
],
"require": {
"php": "^7.2",
"symfony/http-client-contracts": "^1.1 || ^2.0"
"php": "^8.2",
"symfony/http-client-contracts": "^3.4",
"symfony/dependency-injection": "^6.4|^7.0",
"symfony/framework-bundle": "^6.4|^7.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.15",
"phpunit/phpunit": "^8.3",
"symfony/http-client": "^4.4 || ^5.1"
"roave/security-advisories": "dev-latest",
"friendsofphp/php-cs-fixer": "^3.54",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^9.6",
"symfony/http-client": "^6.4|^7.0"
},
"suggest": {
"symfony/http-client": "This package requires an actual Symfony HTTP client implementation to decorate."
Expand All @@ -26,15 +30,21 @@
},
"autoload": {
"psr-4": {
"Superbrave\\VerboseErrorHttpClient\\": "src/"
"Superbrave\\VerboseErrorHttpClientBundle\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Superbrave\\VerboseErrorHttpClient\\Tests\\": "tests/"
"Superbrave\\VerboseErrorHttpClientBundle\\Tests\\": "tests/"
}
},
"config": {
"sort-packages": true
},
"scripts": {
"check-phpstan": "vendor/bin/phpstan analyse",
"check-code-style": "vendor/bin/php-cs-fixer fix --allow-risky=yes --dry-run -v",
"fix-code-style": "vendor/bin/php-cs-fixer fix --allow-risky=yes",
"test": "phpunit"
}
}
Loading
Loading