From 1e58d7863fee52a6a9dd153472f957aee312b954 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Tue, 6 Feb 2018 17:09:17 -0600 Subject: [PATCH 1/2] AuraRouter is an invokable class The `ConfigProvider` incorrectly identified the `AuraRouter` class as a factory previously, which results in an inability to generate the `RouterInterface` service. --- src/AuraRouter/ConfigProvider.php | 5 ++++- test/AuraRouter/ConfigProviderTest.php | 12 +++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/AuraRouter/ConfigProvider.php b/src/AuraRouter/ConfigProvider.php index fc6486e..409f09d 100644 --- a/src/AuraRouter/ConfigProvider.php +++ b/src/AuraRouter/ConfigProvider.php @@ -24,9 +24,12 @@ public function __invoke() : array public function getDependencies() : array { return [ - 'factories' => [ + 'aliases' => [ RouterInterface::class => AuraRouter::class, ], + 'invokables' => [ + AuraRouter::class => AuraRouter::class, + ], ]; } } diff --git a/test/AuraRouter/ConfigProviderTest.php b/test/AuraRouter/ConfigProviderTest.php index 88a386c..ad94582 100644 --- a/test/AuraRouter/ConfigProviderTest.php +++ b/test/AuraRouter/ConfigProviderTest.php @@ -10,6 +10,7 @@ namespace ZendTest\Expressive\Router\AuraRouter; use PHPUnit\Framework\TestCase; +use Zend\Expressive\Router\AuraRouter; use Zend\Expressive\Router\AuraRouter\ConfigProvider; use Zend\Expressive\Router\RouterInterface; @@ -40,8 +41,13 @@ public function testReturnedArrayContainsDependencies(array $config) : void { $this->assertArrayHasKey('dependencies', $config); $this->assertInternalType('array', $config['dependencies']); - $this->assertArrayHasKey('factories', $config['dependencies']); - $this->assertInternalType('array', $config['dependencies']['factories']); - $this->assertArrayHasKey(RouterInterface::class, $config['dependencies']['factories']); + + $this->assertArrayHasKey('aliases', $config['dependencies']); + $this->assertInternalType('array', $config['dependencies']['aliases']); + $this->assertArrayHasKey(RouterInterface::class, $config['dependencies']['aliases']); + + $this->assertArrayHasKey('invokables', $config['dependencies']); + $this->assertInternalType('array', $config['dependencies']['invokables']); + $this->assertArrayHasKey(AuraRouter::class, $config['dependencies']['invokables']); } } From 276a5177eba27ca5366c251f4e6169f92d1cf67f Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Tue, 6 Feb 2018 17:11:29 -0600 Subject: [PATCH 2/2] Adds CHANGELOG for 3.0.0alpha2 --- CHANGELOG.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46bb153..0c00325 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,30 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. +## 3.0.0alpha2 - 2018-02-06 + +### Added + +- Nothing. + +### Changed + +- Nothing. + +### Deprecated + +- Nothing. + +### Removed + +- Nothing. + +### Fixed + +- Fixes the `ConfigProvider` to alias `Zend\Expressive\Router\RouterInterface` + to `Zend\Expressive\Router\AuraRouter`, and to define the latter as an + invokable. + ## 3.0.0alpha1 - 2018-02-06 ### Added