Commit 15cd9611 authored by Sebastian Kehr's avatar Sebastian Kehr 🚣🏼
Browse files

PHP7.1 adjustments

parent 65496054
Pipeline #1359 failed with stages
.idea
.code
vendor
\ No newline at end of file
/vendor
\ No newline at end of file
......@@ -9,20 +9,19 @@
}
],
"require": {
"php": ">=5.3.0",
"php": ">=7.1",
"psr/http-message": "^1.0",
"psr/http-client": "dev-php5.3-compat#263f4701",
"zendframework/zend-psr7bridge": "^0.2"
"psr/http-client": "^1.0",
"zendframework/zend-psr7bridge": "^1.0"
},
"config": {
"platform": {
"php": "7.1"
}
},
"autoload": {
"psr-4": {
"finc\\ZendPsr18Bridge\\": "src/"
}
},
"repositories": [
{
"type": "vcs",
"url": "git@git.sc.uni-leipzig.de:ubl/finc/psr-http-client.git"
}
]
}
}
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "b2e960363471b4adf4e79419380ecc18",
"content-hash": "05f17d2c4bef8cc69cf5dc495f390768",
"packages": [
{
"name": "container-interop/container-interop",
......@@ -88,14 +88,20 @@
},
{
"name": "psr/http-client",
"version": "dev-php5.3-compat",
"version": "1.0.0",
"source": {
"type": "git",
"url": "git@git.sc.uni-leipzig.de:ubl/finc/psr-http-client.git",
"reference": "263f4701"
"url": "https://github.com/php-fig/http-client.git",
"reference": "496a823ef742b632934724bf769560c2a5c7c44e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-client/zipball/496a823ef742b632934724bf769560c2a5c7c44e",
"reference": "496a823ef742b632934724bf769560c2a5c7c44e",
"shasum": ""
},
"require": {
"php": ">=5.3.0",
"php": "^7.0",
"psr/http-message": "^1.0"
},
"type": "library",
......@@ -109,6 +115,7 @@
"Psr\\Http\\Client\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
......@@ -126,7 +133,59 @@
"psr",
"psr-18"
],
"time": "2018-06-07T07:06:42+00:00"
"time": "2018-10-30T23:29:13+00:00"
},
{
"name": "psr/http-factory",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-factory.git",
"reference": "378bfe27931ecc54ff824a20d6f6bfc303bbd04c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-factory/zipball/378bfe27931ecc54ff824a20d6f6bfc303bbd04c",
"reference": "378bfe27931ecc54ff824a20d6f6bfc303bbd04c",
"shasum": ""
},
"require": {
"php": ">=7.0.0",
"psr/http-message": "^1.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Http\\Message\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interfaces for PSR-7 HTTP message factories",
"keywords": [
"factory",
"http",
"message",
"psr",
"psr-17",
"psr-7",
"request",
"response"
],
"time": "2018-07-30T21:54:04+00:00"
},
{
"name": "psr/http-message",
......@@ -180,56 +239,69 @@
},
{
"name": "zendframework/zend-diactoros",
"version": "1.7.2",
"version": "2.1.1",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-diactoros.git",
"reference": "741e7a571836f038de731105f4742ca8a164e43a"
"reference": "c3c330192bc9cc51b7e9ce968ff721dc32ffa986"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/741e7a571836f038de731105f4742ca8a164e43a",
"reference": "741e7a571836f038de731105f4742ca8a164e43a",
"url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/c3c330192bc9cc51b7e9ce968ff721dc32ffa986",
"reference": "c3c330192bc9cc51b7e9ce968ff721dc32ffa986",
"shasum": ""
},
"require": {
"php": "^5.6 || ^7.0",
"php": "^7.1",
"psr/http-factory": "^1.0",
"psr/http-message": "^1.0"
},
"provide": {
"psr/http-factory-implementation": "1.0",
"psr/http-message-implementation": "1.0"
},
"require-dev": {
"ext-dom": "*",
"ext-libxml": "*",
"phpunit/phpunit": "^5.7.16 || ^6.0.8",
"zendframework/zend-coding-standard": "~1.0"
"http-interop/http-factory-tests": "^0.5.0",
"php-http/psr7-integration-tests": "dev-master",
"phpunit/phpunit": "^7.0.2",
"zendframework/zend-coding-standard": "~1.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.7.x-dev",
"dev-develop": "1.8.x-dev",
"dev-release-2.0": "2.0.x-dev"
"dev-master": "2.1.x-dev",
"dev-develop": "2.2.x-dev",
"dev-release-1.8": "1.8.x-dev"
}
},
"autoload": {
"files": [
"src/functions/create_uploaded_file.php",
"src/functions/marshal_headers_from_sapi.php",
"src/functions/marshal_method_from_sapi.php",
"src/functions/marshal_protocol_version_from_sapi.php",
"src/functions/marshal_uri_from_sapi.php",
"src/functions/normalize_server.php",
"src/functions/normalize_uploaded_files.php",
"src/functions/parse_cookie_header.php"
],
"psr-4": {
"Zend\\Diactoros\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-2-Clause"
"BSD-3-Clause"
],
"description": "PSR HTTP Message implementations",
"homepage": "https://github.com/zendframework/zend-diactoros",
"keywords": [
"http",
"psr",
"psr-7"
],
"time": "2018-05-29T16:53:08+00:00"
"time": "2019-01-05T20:13:32+00:00"
},
{
"name": "zendframework/zend-escaper",
......@@ -278,22 +350,22 @@
},
{
"name": "zendframework/zend-http",
"version": "2.8.0",
"version": "2.9.1",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-http.git",
"reference": "f48b276ffa11b48dd1ae3c6bc306d6ed7958ef51"
"reference": "fe80a6bc0b8a632ed878854ee519a2eed4a1e2d0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zendframework/zend-http/zipball/f48b276ffa11b48dd1ae3c6bc306d6ed7958ef51",
"reference": "f48b276ffa11b48dd1ae3c6bc306d6ed7958ef51",
"url": "https://api.github.com/repos/zendframework/zend-http/zipball/fe80a6bc0b8a632ed878854ee519a2eed4a1e2d0",
"reference": "fe80a6bc0b8a632ed878854ee519a2eed4a1e2d0",
"shasum": ""
},
"require": {
"php": "^5.6 || ^7.0",
"zendframework/zend-loader": "^2.5.1",
"zendframework/zend-stdlib": "^3.1 || ^2.7.7",
"zendframework/zend-stdlib": "^3.2.1",
"zendframework/zend-uri": "^2.5.2",
"zendframework/zend-validator": "^2.10.1"
},
......@@ -308,8 +380,8 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.8.x-dev",
"dev-develop": "2.9.x-dev"
"dev-master": "2.9.x-dev",
"dev-develop": "2.10.x-dev"
}
},
"autoload": {
......@@ -329,7 +401,7 @@
"zend",
"zf"
],
"time": "2018-04-26T21:04:50+00:00"
"time": "2019-01-22T19:48:43+00:00"
},
{
"name": "zendframework/zend-loader",
......@@ -378,33 +450,36 @@
},
{
"name": "zendframework/zend-psr7bridge",
"version": "0.2.2",
"version": "1.2.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-psr7bridge.git",
"reference": "86c0b53b0c6381391c4add4a93a56e51d5c74605"
"reference": "99c558f96be01d535fc9692250312342d76d4098"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zendframework/zend-psr7bridge/zipball/86c0b53b0c6381391c4add4a93a56e51d5c74605",
"reference": "86c0b53b0c6381391c4add4a93a56e51d5c74605",
"url": "https://api.github.com/repos/zendframework/zend-psr7bridge/zipball/99c558f96be01d535fc9692250312342d76d4098",
"reference": "99c558f96be01d535fc9692250312342d76d4098",
"shasum": ""
},
"require": {
"php": ">=5.5",
"php": "^5.6 || ^7.0",
"psr/http-message": "^1.0",
"zendframework/zend-diactoros": "^1.1",
"zendframework/zend-http": "^2.5"
"zendframework/zend-diactoros": "^1.7 || ^2.0",
"zendframework/zend-http": "^2.7"
},
"conflict": {
"zendframework/zend-stdlib": "< 3.2.1"
},
"require-dev": {
"phpunit/phpunit": "^4.7",
"squizlabs/php_codesniffer": "^2.3"
"phpunit/phpunit": "^5.7.15 || ^6.5.6",
"zendframework/zend-coding-standard": "~1.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev",
"dev-develop": "1.1-dev"
"dev-master": "1.2.x-dev",
"dev-develop": "1.3.x-dev"
}
},
"autoload": {
......@@ -416,27 +491,29 @@
"license": [
"BSD-3-Clause"
],
"description": "PSR-7 <-> Zend\\Http bridge",
"homepage": "https://github.com/zendframework/zend-psr7bridge",
"description": "PSR-7 &lt;-&gt; zend-http message conversions",
"keywords": [
"ZendFramework",
"http",
"psr",
"psr-7"
"psr-7",
"zend",
"zf"
],
"time": "2016-05-10T21:44:39+00:00"
"time": "2018-12-20T16:48:40+00:00"
},
{
"name": "zendframework/zend-stdlib",
"version": "3.2.0",
"version": "3.2.1",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-stdlib.git",
"reference": "cd164b4a18b5d1aeb69be2c26db035b5ed6925ae"
"reference": "66536006722aff9e62d1b331025089b7ec71c065"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/cd164b4a18b5d1aeb69be2c26db035b5ed6925ae",
"reference": "cd164b4a18b5d1aeb69be2c26db035b5ed6925ae",
"url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/66536006722aff9e62d1b331025089b7ec71c065",
"reference": "66536006722aff9e62d1b331025089b7ec71c065",
"shasum": ""
},
"require": {
......@@ -469,7 +546,7 @@
"stdlib",
"zf"
],
"time": "2018-04-30T13:50:40+00:00"
"time": "2018-08-28T21:34:05+00:00"
},
{
"name": "zendframework/zend-uri",
......@@ -520,25 +597,26 @@
},
{
"name": "zendframework/zend-validator",
"version": "2.10.2",
"version": "2.12.0",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-validator.git",
"reference": "38109ed7d8e46cfa71bccbe7e6ca80cdd035f8c9"
"reference": "64c33668e5fa2d39c6289a878f927ea2b0850c30"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zendframework/zend-validator/zipball/38109ed7d8e46cfa71bccbe7e6ca80cdd035f8c9",
"reference": "38109ed7d8e46cfa71bccbe7e6ca80cdd035f8c9",
"url": "https://api.github.com/repos/zendframework/zend-validator/zipball/64c33668e5fa2d39c6289a878f927ea2b0850c30",
"reference": "64c33668e5fa2d39c6289a878f927ea2b0850c30",
"shasum": ""
},
"require": {
"container-interop/container-interop": "^1.1",
"php": "^5.6 || ^7.0",
"zendframework/zend-stdlib": "^2.7.6 || ^3.1"
"zendframework/zend-stdlib": "^3.2.1"
},
"require-dev": {
"phpunit/phpunit": "^6.0.8 || ^5.7.15",
"psr/http-message": "^1.0",
"zendframework/zend-cache": "^2.6.1",
"zendframework/zend-coding-standard": "~1.0.0",
"zendframework/zend-config": "^2.6",
......@@ -552,6 +630,7 @@
"zendframework/zend-uri": "^2.5"
},
"suggest": {
"psr/http-message": "psr/http-message, required when validating PSR-7 UploadedFileInterface instances via the Upload and UploadFile validators",
"zendframework/zend-db": "Zend\\Db component, required by the (No)RecordExists validator",
"zendframework/zend-filter": "Zend\\Filter component, required by the Digits validator",
"zendframework/zend-i18n": "Zend\\I18n component to allow translation of validation error messages",
......@@ -564,8 +643,8 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.10.x-dev",
"dev-develop": "2.11.x-dev"
"dev-master": "2.12.x-dev",
"dev-develop": "2.13.x-dev"
},
"zf": {
"component": "Zend\\Validator",
......@@ -587,15 +666,13 @@
"validator",
"zf2"
],
"time": "2018-02-01T17:05:33+00:00"
"time": "2019-01-30T14:26:10+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": {
"psr/http-client": 20
},
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
......
......@@ -29,11 +29,12 @@ class Client implements ClientInterface
* @return ResponseInterface
* @throws ClientException
*/
public function sendRequest(RequestInterface $request) {
public function sendRequest(RequestInterface $request): ResponseInterface
{
$requestString = Serializer::toString($request);
$zendRequest = ZendRequest::fromString($requestString);
$zendRequest->getUri()->setHost($request->getUri()->getHost());
try {
$zendResponse = $this->zendClient->send($zendRequest);
} catch (RuntimeException $e) {
......@@ -42,4 +43,6 @@ class Client implements ClientInterface
return Psr7Response::fromZend($zendResponse);
}
}
......@@ -2,7 +2,7 @@
namespace finc\ZendPsr18Bridge;
use Psr\Http\Client\ClientException as ClientExceptionInterface;
use Psr\Http\Client\ClientExceptionInterface;
class ClientException extends \Exception implements ClientExceptionInterface
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment