From a626ceab67493ce49aed98af5971466e6c4d7937 Mon Sep 17 00:00:00 2001 From: oscarotero Date: Thu, 13 Apr 2017 21:30:17 +0200 Subject: [PATCH] updated changelog --- CHANGELOG.md | 30 ++++++++++++++++++++++++++---- src/FastRoute.php | 4 +--- tests/FastRouteTest.php | 5 ----- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b7a5fe..d41495a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,20 +4,36 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). -## 0.5.0 - 2017-02-27 +## [0.6.0] - 2017-04-13 + +### Changed + +* The option `resolver()` accepts any instance of `Middlewares\Utils\CallableResolver\CallableResolverInterface`. + +### Added + +* New option `container()` that works as a shortcut to use a PSR-11 container as a resolver. + +### Fixed + +* The `405` response includes an `Allow` header with the allowed methods for the request. + +## Fixed + +## [0.5.0] - 2017-02-27 ## Changed * Replaced `container-interop` by `psr/container` -## 0.4.0 - 2017-02-05 +## [0.4.0] - 2017-02-05 ## Changed * Updated to `middlewares/utils#~0.9` * Improved route target resolution -## 0.3.0 - 2016-12-26 +## [0.3.0] - 2016-12-26 ### Changed @@ -25,7 +41,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). * Updated to `http-interop/http-middleware#0.4` * Updated `friendsofphp/php-cs-fixer#2.0` -## 0.2.0 - 2016-11-27 +## [0.2.0] - 2016-11-27 ### Changed @@ -34,3 +50,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## 0.1.0 - 2016-10-09 First version + +[0.6.0]: https://github.com/middlewares/fast-route/compare/v0.5.0...v0.6.0 +[0.5.0]: https://github.com/middlewares/fast-route/compare/v0.4.0...v0.5.0 +[0.4.0]: https://github.com/middlewares/fast-route/compare/v0.3.0...v0.4.0 +[0.3.0]: https://github.com/middlewares/fast-route/compare/v0.2.0...v0.3.0 +[0.2.0]: https://github.com/middlewares/fast-route/compare/v0.1.0...v0.2.0 diff --git a/src/FastRoute.php b/src/FastRoute.php index 76ed9f1..248e5c7 100644 --- a/src/FastRoute.php +++ b/src/FastRoute.php @@ -64,9 +64,7 @@ public function resolver(CallableResolverInterface $resolver) */ public function container(ContainerInterface $container) { - $this->resolver = new ContainerResolver($container); - - return $this; + return $this->resolver(new ContainerResolver($container)); } /** diff --git a/tests/FastRouteTest.php b/tests/FastRouteTest.php index b20e22b..b275c7b 100644 --- a/tests/FastRouteTest.php +++ b/tests/FastRouteTest.php @@ -31,7 +31,6 @@ public function testFastRouteOK() new FastRoute($dispatcher), ], $request); - $this->assertInstanceOf('Psr\\Http\\Message\\ResponseInterface', $response); $this->assertEquals('Hello oscarotero (35)', (string) $response->getBody()); } @@ -53,7 +52,6 @@ public function testFastRouteNotFound() new FastRoute($dispatcher), ], $request); - $this->assertInstanceOf('Psr\\Http\\Message\\ResponseInterface', $response); $this->assertEquals(404, $response->getStatusCode()); } @@ -83,7 +81,6 @@ public function testFastRouteNotAllowed() new FastRoute($dispatcher), ], $request); - $this->assertInstanceOf('Psr\\Http\\Message\\ResponseInterface', $response); $this->assertEquals(405, $response->getStatusCode()); $this->assertEquals('POST, PUT', $response->getHeaderLine('Allow')); } @@ -113,7 +110,6 @@ public function testFastRouteResolver() $middleware, ], $request); - $this->assertInstanceOf('Psr\\Http\\Message\\ResponseInterface', $response); $this->assertEquals('Hello oscarotero (35)', (string) $response->getBody()); } @@ -142,7 +138,6 @@ public function testFastRouteContainerResolver() $middleware, ], $request); - $this->assertInstanceOf('Psr\\Http\\Message\\ResponseInterface', $response); $this->assertEquals('Hello oscarotero (35)', (string) $response->getBody()); } }