Skip to content

Commit

Permalink
Merge 2e2bcad into 648bb44
Browse files Browse the repository at this point in the history
  • Loading branch information
lahaxearnaud committed Jan 4, 2022
2 parents 648bb44 + 2e2bcad commit 4e87471
Show file tree
Hide file tree
Showing 10 changed files with 915 additions and 307 deletions.
3 changes: 0 additions & 3 deletions .coveralls.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on: [ "pull_request" ]

jobs:
tests:
strategy:
matrix:
php-versions: [ '7.4' ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: pcov
env:
fail-fast: true
- uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php-versions }}
version: 2
dev: yes
args: --no-interaction --no-progress --prefer-dist
- name: "Run php -l on all bundle files"
run: find . -not -path "./vendor/*" -type f -name '*.php' -exec php -l {} \;
- uses: php-actions/phpstan@v3
with:
path: .
memory_limit: 1G
level: 0
php_version: ${{ matrix.php-versions }}
- name: "Run phpunit"
run: "XDEBUG_MODE=coverage php ./vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml"
- name: "Upload coverage results to Coveralls"
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: "php vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v"
1 change: 0 additions & 1 deletion Http/Exception/CurlTransportException.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ class CurlTransportException extends TransportException
82 => 'CURLE_SSL_CRL_BADFILE',
83 => 'CURLE_SSL_ISSUER_ERROR',
84 => 'CURLE_FTP_PRET_FAILED',
84 => 'CURLE_FTP_PRET_FAILED',
85 => 'CURLE_RTSP_CSEQ_ERROR',
86 => 'CURLE_RTSP_SESSION_ERROR',
87 => 'CURLE_FTP_BAD_FILE_LIST',
Expand Down
10 changes: 6 additions & 4 deletions Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use evaisse\SimpleHttpBundle\Curl\Request as CurlRequest;
use evaisse\SimpleHttpBundle\Curl\RequestGenerator;
use evaisse\SimpleHttpBundle\Http\Exception\CurlTransportException;
use evaisse\SimpleHttpBundle\Http\Exception\ErrorHttpException;
use evaisse\SimpleHttpBundle\Http\Exception\HttpError;
use evaisse\SimpleHttpBundle\Http\Kernel\RemoteHttpKernel;
use Symfony\Component\EventDispatcher\EventDispatcher;
Expand Down Expand Up @@ -231,17 +232,18 @@ public function execute(array $stmts)
public function handle(HttpRequest $request, $type = HttpKernelInterface::SUB_REQUEST, $catch = true)
{
try {
$stmt = new Statement($request);
$stmt = new Statement($request, $this->eventDispatcher, $this);

$this->execute([
$stmt
]);

if ($stmt->hasError()) {
if ($stmt->getError() instanceof HttpError) {
throw $stmt->getError()->createHttpFoundationException();
$error = $stmt->getError();
if ($error instanceof ErrorHttpException) {
throw $error->createHttpFoundationException();
} else {
throw $stmt->getError();
throw $error;
}
}

Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ SimpleHttpBundle
======


### While Still maintained, I recommand you to replace this bundle with the [http-plug bundle](https://github.com/php-http/HttplugBundle) with has better support and a handy plug-in support.
### While Still maintained, I recommand you to replace this bundle with the [symfony/http-client](https://github.com/symfony/http-client) with has better support and a handy plug-in support.

A symfony2/3/4/5 http client bundle built on the httpfoundation component (instead of guzzle), using cURL as engine.


[![testing](https://travis-ci.org/evaisse/SimpleHttpBundle.svg?branch=master)](https://travis-ci.org/evaisse/SimpleHttpBundle)
[![Coverage Status](https://coveralls.io/repos/evaisse/SimpleHttpBundle/badge.svg?branch=master)](https://coveralls.io/r/evaisse/SimpleHttpBundle?branch=master)

Quickstart
Expand Down
24 changes: 0 additions & 24 deletions Tests/Unit/CurlRequestGeneratorTest.php

This file was deleted.

98 changes: 0 additions & 98 deletions Tests/Unit/OAuthClientTest.php

This file was deleted.

4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"ext-curl": "*"
},
"require-dev": {
"satooshi/php-coveralls": "^2.2",
"phpunit/phpunit": ">=5"
"phpunit/phpunit": ">=5",
"php-coveralls/php-coveralls": "^2.5"
},
"suggest": {
},
Expand Down
Loading

0 comments on commit 4e87471

Please sign in to comment.