Skip to content
This repository was archived by the owner on Jul 6, 2024. It is now read-only.

Commit 8d51847

Browse files
author
Dominik Zogg
authored
Merge pull request #4 from chubbyphp/v4
v4
2 parents 0eaa271 + 4787797 commit 8d51847

14 files changed

+9
-441
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ A simple http handler implementation for API.
1414
## Requirements
1515

1616
* php: ^7.2
17-
* chubbyphp/chubbyphp-deserialization: ^2.19
17+
* chubbyphp/chubbyphp-deserialization: ^3.0
1818
* chubbyphp/chubbyphp-negotiation: ^1.7
19-
* chubbyphp/chubbyphp-serialization: ^2.15
19+
* chubbyphp/chubbyphp-serialization: ^3.0
2020
* psr/http-factory: ^1.0.1
2121
* psr/http-message: ^1.0.1
2222
* psr/http-server-middleware: ^1.0.1
@@ -27,7 +27,7 @@ A simple http handler implementation for API.
2727
Through [Composer](http://getcomposer.org) as [chubbyphp/chubbyphp-api-http][1].
2828

2929
```sh
30-
composer require chubbyphp/chubbyphp-api-http "^3.6"
30+
composer require chubbyphp/chubbyphp-api-http "^4.0"
3131
```
3232

3333
## Usage

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
],
1212
"require": {
1313
"php": "^7.2",
14-
"chubbyphp/chubbyphp-deserialization": "^2.19",
14+
"chubbyphp/chubbyphp-deserialization": "^3.0",
1515
"chubbyphp/chubbyphp-negotiation": "^1.7",
16-
"chubbyphp/chubbyphp-serialization": "^2.15",
16+
"chubbyphp/chubbyphp-serialization": "^3.0",
1717
"psr/http-factory": "^1.0.1",
1818
"psr/http-message": "^1.0.1",
1919
"psr/http-server-middleware": "^1.0.1",
@@ -44,7 +44,7 @@
4444
},
4545
"extra": {
4646
"branch-alias": {
47-
"dev-master": "3.6-dev"
47+
"dev-master": "4.0-dev"
4848
}
4949
},
5050
"scripts": {

src/Container/AcceptAndContentTypeMiddlewareFactory.php

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/Container/ApiExceptionMiddlewareFactory.php

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/Container/RequestManagerFactory.php

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/Container/ResponseManagerFactory.php

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/Manager/ResponseManager.php

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Chubbyphp\ApiHttp\Manager;
66

77
use Chubbyphp\ApiHttp\ApiProblem\ApiProblemInterface;
8-
use Chubbyphp\Deserialization\DeserializerInterface;
98
use Chubbyphp\Serialization\Normalizer\NormalizerContextInterface;
109
use Chubbyphp\Serialization\SerializerInterface;
1110
use Psr\Http\Message\ResponseFactoryInterface;
@@ -23,21 +22,10 @@ final class ResponseManager implements ResponseManagerInterface
2322
*/
2423
private $serializer;
2524

26-
public function __construct()
25+
public function __construct(ResponseFactoryInterface $responseFactory, SerializerInterface $serializer)
2726
{
28-
$args = func_get_args();
29-
30-
if ($args[0] instanceof DeserializerInterface) {
31-
@trigger_error(
32-
'Remove deserializer as first argument.',
33-
E_USER_DEPRECATED
34-
);
35-
36-
array_shift($args);
37-
}
38-
39-
$this->setResponseFactory($args[0]);
40-
$this->setSerializer($args[1]);
27+
$this->responseFactory = $responseFactory;
28+
$this->serializer = $serializer;
4129
}
4230

4331
/**
@@ -88,14 +76,4 @@ public function createFromApiProblem(
8876

8977
return $response;
9078
}
91-
92-
private function setResponseFactory(ResponseFactoryInterface $responseFactory): void
93-
{
94-
$this->responseFactory = $responseFactory;
95-
}
96-
97-
private function setSerializer(SerializerInterface $serializer): void
98-
{
99-
$this->serializer = $serializer;
100-
}
10179
}

src/Provider/ApiHttpProvider.php

Lines changed: 0 additions & 27 deletions
This file was deleted.

tests/Unit/Container/AcceptAndContentTypeMiddlewareFactoryTest.php

Lines changed: 0 additions & 50 deletions
This file was deleted.

tests/Unit/Container/ApiExceptionMiddlewareFactoryTest.php

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)