Skip to content

Commit

Permalink
Fixed bug, dropped support for php-http/common:1.x (#33)
Browse files Browse the repository at this point in the history
* Fixed bug, dropped support for php-http/common

* Cs

* Minor
  • Loading branch information
Nyholm authored May 25, 2020
1 parent 8867098 commit 7375352
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ cache:
- $HOME/.composer/cache/files

php:
- 7.1
- 7.2
- 7.3
- 7.4

env:
global:
Expand All @@ -18,7 +18,7 @@ env:
matrix:
fast_finish: true
include:
- php: 7.1
- php: 7.2
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci"

before_install:
Expand Down
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@
"php": "^7.1",
"php-http/httplug": "^1.0 || ^2.0",
"php-http/multipart-stream-builder": "^1.0",
"php-http/client-common": "^1.1 || ^2.0",
"php-http/client-common": "^2.0",
"php-http/discovery": "^1.0"
},
"require-dev": {
"phpunit/phpunit": "^7.4",
"php-http/message-factory": "^1.0",
"php-http/curl-client": "^1.6",
"php-http/curl-client": "^2.0",
"php-http/message": "^1.0",
"guzzlehttp/psr7": "^1.3",
"nyholm/nsa": "^1.0"
"symfony/http-client": "^5.0",
"nyholm/nsa": "^1.1",
"nyholm/psr7": "^1.3"
},
"autoload": {
"psr-4": {
Expand Down
9 changes: 0 additions & 9 deletions src/Api/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,6 @@ public function update(int $id, string $email, string $firstName, string $lastNa
return $response;
}

/**
* @param string $email
* @param string $firstName
* @param string $lastName
* @param string $gender
* @param array $optionalParams
*
* @return array
*/
private function validateAndGetParams(string $email, string $firstName, string $lastName, string $gender, array $optionalParams): array
{
if (empty($email)) {
Expand Down
3 changes: 2 additions & 1 deletion src/Http/AuthenticationPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace FAPI\Sylius\Http;

use Http\Client\Common\Plugin;
use Http\Promise\Promise;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;

Expand Down Expand Up @@ -40,7 +41,7 @@ public function __construct(Authenticator $authenticator, string $accessToken)
$this->accessToken = \json_decode($accessToken, true);
}

public function handleRequest(RequestInterface $request, callable $next, callable $first)
public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise
{
if (null === $this->accessToken) {
return $next($request);
Expand Down

0 comments on commit 7375352

Please sign in to comment.