-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from niels-nijens/initial
Initial HTTP client package
- Loading branch information
Showing
15 changed files
with
3,928 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/vendor/ | ||
*.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->exclude('vendor') | ||
->in(__DIR__); | ||
|
||
return PhpCsFixer\Config::create() | ||
->setRules([ | ||
'@Symfony' => true, | ||
'yoda_style' => null, // Do not enforce Yoda style (add unit tests instead...) | ||
'ordered_imports' => true, | ||
]) | ||
->setFinder($finder); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
filter: | ||
excluded_paths: | ||
- 'tests/*' | ||
|
||
dependency_paths: | ||
- 'vendor/' | ||
|
||
checks: | ||
php: true | ||
|
||
build: | ||
dependencies: | ||
before: | ||
- restore-from-cache repository "dependencies" | ||
|
||
override: | ||
- composer install --no-interaction --optimize-autoloader | ||
- command: wget https://get.symfony.com/cli/installer -O - | bash | ||
only_if: '[ "$SCRUTINIZER_BRANCH" == "master" ] && [ -z "$SCRUTINIZER_PR_SOURCE_BRANCH" ]' | ||
|
||
after: | ||
- store-in-cache repository "dependencies" vendor/ | ||
|
||
nodes: | ||
tests: | ||
tests: | ||
override: | ||
- composer validate | ||
|
||
- ./vendor/bin/php-cs-fixer fix --dry-run -v | ||
|
||
- command: '~/.symfony/bin/symfony security:check --force-update' | ||
only_if: '[ "$SCRUTINIZER_BRANCH" == "master" ] && [ -z "$SCRUTINIZER_PR_SOURCE_BRANCH" ]' | ||
|
||
- command: './vendor/bin/phpunit --coverage-clover=coverage-clover.xml' | ||
coverage: | ||
file: 'coverage-clover.xml' | ||
format: 'clover' | ||
|
||
- php-scrutinizer-run | ||
|
||
environment: | ||
php: | ||
version: '7.2' | ||
|
||
build_failure_conditions: | ||
- 'elements.rating(<= D).new.exists' # No new classes/methods with a rating of D or worse. | ||
- 'project.metric("scrutinizer.quality", < 8)' # Code Quality Rating drops below 8. | ||
- 'project.metric("scrutinizer.test_coverage", < 0.80)' # Code Coverage drops below 80%. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,48 @@ | ||
# verbose-error-http-client | ||
# Verbose error HTTP client | ||
|
||
[![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 | ||
``` | ||
|
||
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; | ||
|
||
$httpClient = HttpClient::create(); | ||
$verboseErrorHttpClient = new VerboseErrorHttpClient($httpClient); | ||
|
||
$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. | ||
|
||
[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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"name": "superbrave/verbose-error-http-client", | ||
"description": "Increased verbosity of error messages in the Symfony HTTP client.", | ||
"type": "library", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Niels Nijens", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require": { | ||
"php": "^7.2", | ||
"symfony/http-client-contracts": "^1.1" | ||
}, | ||
"require-dev": { | ||
"friendsofphp/php-cs-fixer": "^2.15", | ||
"phpunit/phpunit": "^8.3", | ||
"symfony/http-client": "^4.3" | ||
}, | ||
"suggest": { | ||
"symfony/http-client": "This package requires an actual Symfony HTTP client implementation to decorate." | ||
}, | ||
"provide": { | ||
"symfony/http-client-implementation": "1.1" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Superbrave\\VerboseErrorHttpClient\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Superbrave\\VerboseErrorHttpClient\\Tests\\": "tests/" | ||
} | ||
}, | ||
"config": { | ||
"sort-packages": true | ||
} | ||
} |
Oops, something went wrong.