Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit afb295c

Browse files
committed
Merge branch 'hotfix/response-prototype'
Close #22
2 parents 6d16330 + 0209bdd commit afb295c

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,30 @@
22

33
All notable changes to this project will be documented in this file, in reverse chronological order by release.
44

5+
## 0.3.1 - 2018-03-12
6+
7+
### Added
8+
9+
- Nothing.
10+
11+
### Changed
12+
13+
- [#22](https://github.com/zendframework/zend-expressive-authentication/issues/22)
14+
updates the `ResponsePrototypeTrait` to allow callable `ResponseInterface`
15+
services (instead of those directly returning a `ResponseInterface`).
16+
17+
### Deprecated
18+
19+
- Nothing.
20+
21+
### Removed
22+
23+
- Nothing.
24+
25+
### Fixed
26+
27+
- Nothing.
28+
529
## 0.3.0 - 2018-01-24
630

731
### Added

src/ResponsePrototypeTrait.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,12 @@ protected function getResponsePrototype(ContainerInterface $container) : Respons
2929
ResponseInterface::class
3030
));
3131
}
32-
return $container->has(ResponseInterface::class)
32+
33+
$response = $container->has(ResponseInterface::class)
3334
? $container->get(ResponseInterface::class)
3435
: new Response();
36+
37+
// Allow usage of callable factories to generate a response.
38+
return is_callable($response) ? $response() : $response;
3539
}
3640
}

0 commit comments

Comments
 (0)