Add official PSR-15 interfaces via composer

This commit is contained in:
PJ Dietz 2018-03-12 09:59:23 -04:00
parent 4c40db8ecc
commit e531af0da5
4 changed files with 147 additions and 64 deletions

View File

@ -12,16 +12,17 @@
}
],
"require": {
"php": ">=5.4.0",
"psr/http-message": "~1.0"
"php": ">=7.0",
"psr/http-message": "~1.0",
"psr/http-server-handler": "~1.0",
"psr/http-server-middleware": "~1.0"
},
"require-dev": {
"phpunit/phpunit": "^6"
},
"autoload": {
"psr-4": {
"WellRESTed\\": "src/",
"Psr\\Http\\Server\\": "src-fig/"
"WellRESTed\\": "src/"
}
}
}

178
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "6ea4dfb3d423c379a6946d8338b9483f",
"content-hash": "a5dd658181aa761fd65b76469bed3998",
"packages": [
{
"name": "psr/http-message",
@ -55,6 +55,112 @@
"response"
],
"time": "2016-08-06T14:39:51+00:00"
},
{
"name": "psr/http-server-handler",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-server-handler.git",
"reference": "439d92054dc06097f2406ec074a2627839955a02"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-server-handler/zipball/439d92054dc06097f2406ec074a2627839955a02",
"reference": "439d92054dc06097f2406ec074a2627839955a02",
"shasum": ""
},
"require": {
"php": ">=7.0",
"psr/http-message": "^1.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Http\\Server\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for HTTP server-side request handler",
"keywords": [
"handler",
"http",
"http-interop",
"psr",
"psr-15",
"psr-7",
"request",
"response",
"server"
],
"time": "2018-01-22T17:04:15+00:00"
},
{
"name": "psr/http-server-middleware",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-server-middleware.git",
"reference": "ea17eb1fb2c8df6db919cc578451a8013c6a0ae5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-server-middleware/zipball/ea17eb1fb2c8df6db919cc578451a8013c6a0ae5",
"reference": "ea17eb1fb2c8df6db919cc578451a8013c6a0ae5",
"shasum": ""
},
"require": {
"php": ">=7.0",
"psr/http-message": "^1.0",
"psr/http-server-handler": "^1.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Http\\Server\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for HTTP server-side middleware",
"keywords": [
"http",
"http-interop",
"middleware",
"psr",
"psr-15",
"psr-7",
"request",
"response"
],
"time": "2018-01-22T17:08:31+00:00"
}
],
"packages-dev": [
@ -315,16 +421,16 @@
},
{
"name": "phpdocumentor/reflection-docblock",
"version": "4.2.0",
"version": "4.3.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
"reference": "66465776cfc249844bde6d117abff1d22e06c2da"
"reference": "94fd0001232e47129dd3504189fa1c7225010d08"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/66465776cfc249844bde6d117abff1d22e06c2da",
"reference": "66465776cfc249844bde6d117abff1d22e06c2da",
"url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08",
"reference": "94fd0001232e47129dd3504189fa1c7225010d08",
"shasum": ""
},
"require": {
@ -362,7 +468,7 @@
}
],
"description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
"time": "2017-11-27T17:38:31+00:00"
"time": "2017-11-30T07:14:17+00:00"
},
{
"name": "phpdocumentor/type-resolver",
@ -413,16 +519,16 @@
},
{
"name": "phpspec/prophecy",
"version": "1.7.3",
"version": "1.7.5",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
"reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf"
"reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf",
"reference": "e4ed002c67da8eceb0eb8ddb8b3847bb53c5c2bf",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/dfd6be44111a7c41c2e884a336cc4f461b3b2401",
"reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401",
"shasum": ""
},
"require": {
@ -434,7 +540,7 @@
},
"require-dev": {
"phpspec/phpspec": "^2.5|^3.2",
"phpunit/phpunit": "^4.8.35 || ^5.7"
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5"
},
"type": "library",
"extra": {
@ -472,7 +578,7 @@
"spy",
"stub"
],
"time": "2017-11-24T13:59:53+00:00"
"time": "2018-02-19T10:16:54+00:00"
},
{
"name": "phpunit/php-code-coverage",
@ -725,16 +831,16 @@
},
{
"name": "phpunit/phpunit",
"version": "6.5.3",
"version": "6.5.7",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "882e886cc928a0abd3c61282b2a64026237d14a4"
"reference": "6bd77b57707c236833d2b57b968e403df060c9d9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/882e886cc928a0abd3c61282b2a64026237d14a4",
"reference": "882e886cc928a0abd3c61282b2a64026237d14a4",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6bd77b57707c236833d2b57b968e403df060c9d9",
"reference": "6bd77b57707c236833d2b57b968e403df060c9d9",
"shasum": ""
},
"require": {
@ -752,7 +858,7 @@
"phpunit/php-file-iterator": "^1.4.3",
"phpunit/php-text-template": "^1.2.1",
"phpunit/php-timer": "^1.0.9",
"phpunit/phpunit-mock-objects": "^5.0.4",
"phpunit/phpunit-mock-objects": "^5.0.5",
"sebastian/comparator": "^2.1",
"sebastian/diff": "^2.0",
"sebastian/environment": "^3.1",
@ -805,27 +911,27 @@
"testing",
"xunit"
],
"time": "2017-12-06T09:42:03+00:00"
"time": "2018-02-26T07:01:09+00:00"
},
{
"name": "phpunit/phpunit-mock-objects",
"version": "5.0.4",
"version": "5.0.6",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
"reference": "16b50f4167e5e85e81ca8a3dd105d0a5fd32009a"
"reference": "33fd41a76e746b8fa96d00b49a23dadfa8334cdf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/16b50f4167e5e85e81ca8a3dd105d0a5fd32009a",
"reference": "16b50f4167e5e85e81ca8a3dd105d0a5fd32009a",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/33fd41a76e746b8fa96d00b49a23dadfa8334cdf",
"reference": "33fd41a76e746b8fa96d00b49a23dadfa8334cdf",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.0.5",
"php": "^7.0",
"phpunit/php-text-template": "^1.2.1",
"sebastian/exporter": "^3.0"
"sebastian/exporter": "^3.1"
},
"conflict": {
"phpunit/phpunit": "<6.0"
@ -864,7 +970,7 @@
"mock",
"xunit"
],
"time": "2017-12-02T05:31:19+00:00"
"time": "2018-01-06T05:45:45+00:00"
},
{
"name": "sebastian/code-unit-reverse-lookup",
@ -913,21 +1019,21 @@
},
{
"name": "sebastian/comparator",
"version": "2.1.0",
"version": "2.1.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/comparator.git",
"reference": "1174d9018191e93cb9d719edec01257fc05f8158"
"reference": "34369daee48eafb2651bea869b4b15d75ccc35f9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1174d9018191e93cb9d719edec01257fc05f8158",
"reference": "1174d9018191e93cb9d719edec01257fc05f8158",
"url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9",
"reference": "34369daee48eafb2651bea869b4b15d75ccc35f9",
"shasum": ""
},
"require": {
"php": "^7.0",
"sebastian/diff": "^2.0",
"sebastian/diff": "^2.0 || ^3.0",
"sebastian/exporter": "^3.1"
},
"require-dev": {
@ -973,7 +1079,7 @@
"compare",
"equality"
],
"time": "2017-11-03T07:16:52+00:00"
"time": "2018-02-01T13:46:46+00:00"
},
{
"name": "sebastian/diff",
@ -1467,16 +1573,16 @@
},
{
"name": "webmozart/assert",
"version": "1.2.0",
"version": "1.3.0",
"source": {
"type": "git",
"url": "https://github.com/webmozart/assert.git",
"reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f"
"reference": "0df1908962e7a3071564e857d86874dad1ef204a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/webmozart/assert/zipball/2db61e59ff05fe5126d152bd0655c9ea113e550f",
"reference": "2db61e59ff05fe5126d152bd0655c9ea113e550f",
"url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a",
"reference": "0df1908962e7a3071564e857d86874dad1ef204a",
"shasum": ""
},
"require": {
@ -1513,7 +1619,7 @@
"check",
"validate"
],
"time": "2016-11-23T20:04:58+00:00"
"time": "2018-01-29T19:49:41+00:00"
}
],
"aliases": [],
@ -1522,7 +1628,7 @@
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=5.4.0"
"php": ">=7.0"
},
"platform-dev": []
}

View File

@ -1,13 +0,0 @@
<?php
namespace Psr\Http\Server;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
interface MiddlewareInterface
{
public function process(
ServerRequestInterface $request,
RequestHandlerInterface $handler): ResponseInterface;
}

View File

@ -1,11 +0,0 @@
<?php
namespace Psr\Http\Server;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
interface RequestHandlerInterface
{
public function handle(ServerRequestInterface $request): ResponseInterface;
}