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

Commit 907c333

Browse files
author
Dominik Zogg
committed
named service factories
1 parent d13504e commit 907c333

22 files changed

+569
-60
lines changed

README.md

Lines changed: 8 additions & 8 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.18
18-
* chubbyphp/chubbyphp-negotiation: ^1.6
19-
* chubbyphp/chubbyphp-serialization: ^2.14
17+
* chubbyphp/chubbyphp-deserialization: ^2.19
18+
* chubbyphp/chubbyphp-negotiation: ^1.7
19+
* chubbyphp/chubbyphp-serialization: ^2.15
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.5"
30+
composer require chubbyphp/chubbyphp-api-http "^3.6"
3131
```
3232

3333
## Usage
@@ -51,10 +51,10 @@ Dominik Zogg 2020
5151

5252
[1]: https://packagist.org/packages/chubbyphp/chubbyphp-api-http
5353
[2]: doc/ApiProblem/ApiProblem.md
54-
[3]: doc/Container/AcceptAndContentTypeMiddlewareFactory.md
55-
[4]: doc/Container/ApiExceptionMiddlewareFactory.md
56-
[5]: doc/Container/RequestManagerFactory.md
57-
[6]: doc/Container/ResponseManagerFactory.md
54+
[3]: doc/ServiceFactory/AcceptAndContentTypeMiddlewareFactory.md
55+
[4]: doc/ServiceFactory/ApiExceptionMiddlewareFactory.md
56+
[5]: doc/ServiceFactory/RequestManagerFactory.md
57+
[6]: doc/ServiceFactory/ResponseManagerFactory.md
5858
[7]: doc/Manager/RequestManager.md
5959
[8]: doc/Manager/ResponseManager.md
6060
[9]: doc/Middleware/AcceptAndContentTypeMiddleware.md

composer.json

Lines changed: 5 additions & 4 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.18",
15-
"chubbyphp/chubbyphp-negotiation": "^1.6",
16-
"chubbyphp/chubbyphp-serialization": "^2.14",
14+
"chubbyphp/chubbyphp-deserialization": "^2.19",
15+
"chubbyphp/chubbyphp-negotiation": "^1.7",
16+
"chubbyphp/chubbyphp-serialization": "^2.15",
1717
"psr/http-factory": "^1.0.1",
1818
"psr/http-message": "^1.0.1",
1919
"psr/http-server-middleware": "^1.0.1",
@@ -22,6 +22,7 @@
2222
"require-dev": {
2323
"chubbyphp/chubbyphp-container": "^1.1",
2424
"chubbyphp/chubbyphp-dev-helper": "dev-master",
25+
"chubbyphp/chubbyphp-laminas-config-factory": "^1.0",
2526
"chubbyphp/chubbyphp-mock": "^1.4.5",
2627
"infection/infection": "^0.15.3|^0.16.4",
2728
"mavimo/phpstan-junit": "^0.3",
@@ -43,7 +44,7 @@
4344
},
4445
"extra": {
4546
"branch-alias": {
46-
"dev-master": "3.5-dev"
47+
"dev-master": "3.6-dev"
4748
}
4849
},
4950
"scripts": {

doc/Container/AcceptAndContentTypeMiddlewareFactory.md

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

doc/Container/ApiExceptionMiddlewareFactory.md

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

doc/Container/RequestManagerFactory.md

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

doc/Container/ResponseManagerFactory.md

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# AcceptAndContentTypeMiddlewareFactory
2+
3+
## without name (default)
4+
5+
```php
6+
<?php
7+
8+
use Chubbyphp\ApiHttp\Container\AcceptAndContentTypeMiddlewareFactory;
9+
use Psr\Container\ContainerInterface;
10+
11+
/** @var ContainerInterface $container */
12+
$container = ...;
13+
14+
$factory = new AcceptAndContentTypeMiddlewareFactory();
15+
16+
$acceptAndContentTypeMiddleware = $factory($container);
17+
```
18+
19+
## with name `default`
20+
21+
```php
22+
<?php
23+
24+
use Chubbyphp\ApiHttp\Container\AcceptAndContentTypeMiddlewareFactory;
25+
use Psr\Container\ContainerInterface;
26+
27+
/** @var ContainerInterface $container */
28+
$container = ...;
29+
30+
$factory = [AcceptAndContentTypeMiddlewareFactory::class, 'default'];
31+
32+
$acceptAndContentTypeMiddleware = $factory($container);
33+
```
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# ApiExceptionMiddlewareFactory
2+
3+
## without name (default)
4+
5+
```php
6+
<?php
7+
8+
use Chubbyphp\ApiHttp\ServiceFactory\ApiExceptionMiddlewareFactory;
9+
use Psr\Container\ContainerInterface;
10+
11+
/** @var ContainerInterface $container */
12+
$container = ...;
13+
14+
$factory = new ApiExceptionMiddlewareFactory();
15+
16+
$apiExceptionMiddleware = $factory($container);
17+
```
18+
19+
## with name `default`
20+
21+
```php
22+
<?php
23+
24+
use Chubbyphp\ApiHttp\ServiceFactory\ApiExceptionMiddlewareFactory;
25+
use Psr\Container\ContainerInterface;
26+
27+
/** @var ContainerInterface $container */
28+
$container = ...;
29+
30+
$factory = [ApiExceptionMiddlewareFactory::class, 'default'];
31+
32+
$apiExceptionMiddleware = $factory($container);
33+
```
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# RequestManagerFactory
2+
3+
## without name (default)
4+
5+
```php
6+
<?php
7+
8+
use Chubbyphp\ApiHttp\Container\RequestManagerFactory;
9+
use Psr\Container\ContainerInterface;
10+
11+
/** @var ContainerInterface $container */
12+
$container = ...;
13+
14+
$factory = new RequestManagerFactory();
15+
16+
$requestManager = $factory($container);
17+
```
18+
19+
## with name `default`
20+
21+
```php
22+
<?php
23+
24+
use Chubbyphp\ApiHttp\Container\RequestManagerFactory;
25+
use Psr\Container\ContainerInterface;
26+
27+
/** @var ContainerInterface $container */
28+
$container = ...;
29+
30+
$factory = [RequestManagerFactory::class, 'default'];
31+
32+
$requestManager = $factory($container);
33+
```
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# ResponseManagerFactory
2+
3+
## without name (default)
4+
5+
```php
6+
<?php
7+
8+
use Chubbyphp\ApiHttp\Container\ResponseManagerFactory;
9+
use Psr\Container\ContainerInterface;
10+
11+
/** @var ContainerInterface $container */
12+
$container = ...;
13+
14+
$factory = new ResponseManagerFactory();
15+
16+
$responseManager = $factory($container);
17+
```
18+
19+
## with name `default`
20+
21+
```php
22+
<?php
23+
24+
use Chubbyphp\ApiHttp\Container\ResponseManagerFactory;
25+
use Psr\Container\ContainerInterface;
26+
27+
/** @var ContainerInterface $container */
28+
$container = ...;
29+
30+
$factory = [ResponseManagerFactory::class, 'default'];
31+
32+
$responseManager = $factory($container);
33+
```

0 commit comments

Comments
 (0)