Skip to content

Commit 40574db

Browse files
committed
updated http-middleware interface to 0.3
1 parent ec0e275 commit 40574db

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## 0.2.0 - 2016-11-27
8+
9+
### Changed
10+
11+
* Updated to `http-interop/http-middleware#0.3`
12+
713
## 0.1.0 - 2016-10-08
814

915
First version

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
# middlewares/aura-session
22

33
[![Latest Version on Packagist][ico-version]][link-packagist]
4-
[![Software License][ico-license]](LICENSE.md)
4+
[![Software License][ico-license]](LICENSE)
55
[![Build Status][ico-travis]][link-travis]
66
[![Quality Score][ico-scrutinizer]][link-scrutinizer]
77
[![Total Downloads][ico-downloads]][link-downloads]
88
[![SensioLabs Insight][ico-sensiolabs]][link-sensiolabs]
99

1010
Middleware to manage sessions using [Aura.Session](https://github.com/auraphp/Aura.Session).
1111

12-
**Note:** This middleware is intended for server side only
13-
1412
## Requirements
1513

1614
* PHP >= 5.6
1715
* A [PSR-7](https://packagist.org/providers/psr/http-message-implementation) http mesage implementation ([Diactoros](https://github.com/zendframework/zend-diactoros), [Guzzle](https://github.com/guzzle/psr7), [Slim](https://github.com/slimphp/Slim), etc...)
18-
* A [PSR-15](https://github.com/http-interop/http-middleware) middleware dispatcher ([Middleman](https://github.com/mindplay-dk/middleman), etc...)
16+
* A [PSR-15 middleware dispatcher](https://github.com/middlewares/awesome-psr15-middlewares#dispatcher)
1917

2018
## Installation
2119

@@ -52,7 +50,7 @@ The session name. If it's not defined, the default `PHPSESSID` will be used.
5250

5351
#### `attribute(string $attribute)`
5452

55-
The attribute name used to store the session in the session request. By default is `session`.
53+
The attribute name used to store the session in the server request. By default is `session`.
5654

5755
---
5856

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
},
1919
"require": {
2020
"php": "^5.6 || ^7.0",
21-
"http-interop/http-middleware": "^0.2",
21+
"http-interop/http-middleware": "^0.3",
2222
"aura/session": "^2.1"
2323
},
2424
"require-dev": {
2525
"phpunit/phpunit": "^5.5",
2626
"zendframework/zend-diactoros": "^1.3",
2727
"friendsofphp/php-cs-fixer": "^1.12",
2828
"squizlabs/php_codesniffer": "^2.7",
29-
"mindplay/middleman": "^2.0"
29+
"middlewares/utils": "~0.5"
3030
},
3131
"autoload": {
3232
"psr-4": {

tests/AuraSessionTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,26 @@
33
namespace Middlewares\Tests;
44

55
use Middlewares\AuraSession;
6+
use Middlewares\Utils\Dispatcher;
7+
use Middlewares\Utils\CallableMiddleware;
68
use Zend\Diactoros\ServerRequest;
79
use Zend\Diactoros\Response;
8-
use mindplay\middleman\Dispatcher;
910

1011
class AuraSessionTest extends \PHPUnit_Framework_TestCase
1112
{
1213
public function testAuraSession()
1314
{
1415
$response = (new Dispatcher([
1516
(new AuraSession())->name('custom-session'),
16-
function ($request) {
17+
new CallableMiddleware(function ($request) {
1718
$session = $request->getAttribute('session');
1819
$this->assertInstanceOf('Aura\\Session\\Session', $session);
1920

2021
$response = new Response();
2122
$response->getBody()->write($session->getName());
23+
2224
return $response;
23-
},
25+
}),
2426
]))->dispatch(new ServerRequest());
2527

2628
$this->assertInstanceOf('Psr\\Http\\Message\\ResponseInterface', $response);

0 commit comments

Comments
 (0)