From e3de57fb5d2ee535fc6aad11373c636d14cfd353 Mon Sep 17 00:00:00 2001 From: smiley Date: Thu, 20 Oct 2022 22:18:32 +0200 Subject: [PATCH 1/2] factory aware interfaces & traits --- src/RequestFactoryAwareInterface.php | 9 +++++++++ src/RequestFactoryAwareTrait.php | 16 ++++++++++++++++ src/ResponseFactoryAwareInterface.php | 9 +++++++++ src/ResponseFactoryAwareTrait.php | 16 ++++++++++++++++ src/ServerRequestFactoryAwareInterface.php | 9 +++++++++ src/ServerRequestFactoryAwareTrait.php | 16 ++++++++++++++++ src/StreamFactoryAwareInterface.php | 9 +++++++++ src/StreamFactoryAwareTrait.php | 16 ++++++++++++++++ src/UploadedFileFactoryAwareInterface.php | 9 +++++++++ src/UploadedFileFactoryAwareTrait.php | 16 ++++++++++++++++ src/UriFactoryAwareInterface.php | 9 +++++++++ src/UriFactoryAwareTrait.php | 16 ++++++++++++++++ 12 files changed, 150 insertions(+) create mode 100644 src/RequestFactoryAwareInterface.php create mode 100644 src/RequestFactoryAwareTrait.php create mode 100644 src/ResponseFactoryAwareInterface.php create mode 100644 src/ResponseFactoryAwareTrait.php create mode 100644 src/ServerRequestFactoryAwareInterface.php create mode 100644 src/ServerRequestFactoryAwareTrait.php create mode 100644 src/StreamFactoryAwareInterface.php create mode 100644 src/StreamFactoryAwareTrait.php create mode 100644 src/UploadedFileFactoryAwareInterface.php create mode 100644 src/UploadedFileFactoryAwareTrait.php create mode 100644 src/UriFactoryAwareInterface.php create mode 100644 src/UriFactoryAwareTrait.php diff --git a/src/RequestFactoryAwareInterface.php b/src/RequestFactoryAwareInterface.php new file mode 100644 index 0000000..36fea8c --- /dev/null +++ b/src/RequestFactoryAwareInterface.php @@ -0,0 +1,9 @@ +requestFactory = $requestFactory; + + return $this; + } + +} diff --git a/src/ResponseFactoryAwareInterface.php b/src/ResponseFactoryAwareInterface.php new file mode 100644 index 0000000..7257421 --- /dev/null +++ b/src/ResponseFactoryAwareInterface.php @@ -0,0 +1,9 @@ +responseFactory = $responseFactory; + + return $this; + } + +} diff --git a/src/ServerRequestFactoryAwareInterface.php b/src/ServerRequestFactoryAwareInterface.php new file mode 100644 index 0000000..61ececd --- /dev/null +++ b/src/ServerRequestFactoryAwareInterface.php @@ -0,0 +1,9 @@ +serverRequestFactory = $serverRequestFactory; + + return $this; + } + +} diff --git a/src/StreamFactoryAwareInterface.php b/src/StreamFactoryAwareInterface.php new file mode 100644 index 0000000..825b8c9 --- /dev/null +++ b/src/StreamFactoryAwareInterface.php @@ -0,0 +1,9 @@ +streamFactory = $streamFactory; + + return $this; + } + +} diff --git a/src/UploadedFileFactoryAwareInterface.php b/src/UploadedFileFactoryAwareInterface.php new file mode 100644 index 0000000..9539ba4 --- /dev/null +++ b/src/UploadedFileFactoryAwareInterface.php @@ -0,0 +1,9 @@ +uploadedFileFactory = $uploadedFileFactory; + + return $this; + } + +} diff --git a/src/UriFactoryAwareInterface.php b/src/UriFactoryAwareInterface.php new file mode 100644 index 0000000..0995086 --- /dev/null +++ b/src/UriFactoryAwareInterface.php @@ -0,0 +1,9 @@ +uriFactory = $uriFactory; + + return $this; + } + +} From 25528061d9d6235359c0fa0a31535ee0aa52c978 Mon Sep 17 00:00:00 2001 From: smiley Date: Thu, 20 Oct 2022 22:19:56 +0200 Subject: [PATCH 2/2] package mets --- .gitignore | 2 ++ README.md | 1 + composer.json | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 composer.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d8a7996 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +composer.lock +vendor/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..4ae18b5 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# PSR-17 HTTP Factory Utilities diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..b7a1552 --- /dev/null +++ b/composer.json @@ -0,0 +1,40 @@ +{ + "name": "psr/http-factory-util", + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "psr", + "psr-7", + "psr-17", + "http", + "factory", + "message", + "request", + "response" + ], + "license": "MIT", + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "require": { + "php": ">=7.0.0" + }, + "require-dev": { + "psr/http-factory": "^1.0" + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "config": { + "lock": false + } +}