From 3852849c3bd223ca88ae1543e4d940de589fa107 Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Thu, 7 Jul 2016 08:45:11 -0500 Subject: [PATCH 1/2] Ensure all factories are compatible with both major versions of zend-servicemanager - Removed `FactoryInterface` implmentation at class level; since each now implements an `__invoke()` method, they are each compatible with both major versions. - Updated all factories to only accept the arguments they use (as we are not implementing an interface). - Ensured all factories that pull the config service use `config` vs `Config` for forwards compatibility. --- src/Factory/ApiProblemListenerFactory.php | 19 +++++++----------- src/Factory/ApiProblemRendererFactory.php | 20 ++++++------------- src/Factory/ApiProblemStrategyFactory.php | 18 +++++------------ src/Factory/RenderErrorListenerFactory.php | 20 ++++++------------- .../SendApiProblemResponseListenerFactory.php | 14 +++++++------ 5 files changed, 32 insertions(+), 59 deletions(-) diff --git a/src/Factory/ApiProblemListenerFactory.php b/src/Factory/ApiProblemListenerFactory.php index 3266fbb..a88c3d9 100644 --- a/src/Factory/ApiProblemListenerFactory.php +++ b/src/Factory/ApiProblemListenerFactory.php @@ -1,32 +1,27 @@ has('Config')) { - $config = $container->get('Config'); + if ($container->has('config')) { + $config = $container->get('config'); } if (isset($config['zf-api-problem']['accept_filters'])) { diff --git a/src/Factory/ApiProblemRendererFactory.php b/src/Factory/ApiProblemRendererFactory.php index b622562..755f528 100644 --- a/src/Factory/ApiProblemRendererFactory.php +++ b/src/Factory/ApiProblemRendererFactory.php @@ -1,31 +1,23 @@ get('Config'); + $config = $container->get('config'); $displayExceptions = isset($config['view_manager']) && isset($config['view_manager']['display_exceptions']) && $config['view_manager']['display_exceptions']; diff --git a/src/Factory/ApiProblemStrategyFactory.php b/src/Factory/ApiProblemStrategyFactory.php index f71f381..a59eff9 100644 --- a/src/Factory/ApiProblemStrategyFactory.php +++ b/src/Factory/ApiProblemStrategyFactory.php @@ -1,30 +1,22 @@ get(ApiProblemRenderer::class)); } diff --git a/src/Factory/RenderErrorListenerFactory.php b/src/Factory/RenderErrorListenerFactory.php index 3e063a7..7e84ce1 100644 --- a/src/Factory/RenderErrorListenerFactory.php +++ b/src/Factory/RenderErrorListenerFactory.php @@ -1,31 +1,23 @@ get('Config'); + $config = $container->get('config'); $displayExceptions = false; if (isset($config['view_manager']) diff --git a/src/Factory/SendApiProblemResponseListenerFactory.php b/src/Factory/SendApiProblemResponseListenerFactory.php index c2826e7..9a9ca02 100644 --- a/src/Factory/SendApiProblemResponseListenerFactory.php +++ b/src/Factory/SendApiProblemResponseListenerFactory.php @@ -1,22 +1,24 @@ get('Config'); + $config = $container->get('config'); $displayExceptions = isset($config['view_manager']) && isset($config['view_manager']['display_exceptions']) && $config['view_manager']['display_exceptions']; From b868185d2d613778fffc594fb73134259c0dbc8c Mon Sep 17 00:00:00 2001 From: Matthew Weier O'Phinney Date: Thu, 7 Jul 2016 08:51:54 -0500 Subject: [PATCH 2/2] Added CHANGELOG for #47 --- CHANGELOG.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79af934..bbfcfe6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. -## 1.2.1 - TBD +## 1.2.1 - 2016-07-07 ### Added @@ -18,7 +18,10 @@ All notable changes to this project will be documented in this file, in reverse ### Fixed -- Nothing. +- [#47](https://github.com/zfcampus/zf-api-problem/pull/47) fixes an issue with + the various factories introduced in 1.2.0; they had been updated to implement the + zend-servicemanager v3 interfaces, which broke usage with v2. They are now + written in a way that will work with both versions. ## 1.2.0 - 2016-07-06