Skip to content

Commit d0b8ed2

Browse files
committed
Merge branch 'hotfix/46' into develop
Conflicts: CHANGELOG.md
2 parents 77a92d8 + b868185 commit d0b8ed2

File tree

6 files changed

+37
-61
lines changed

6 files changed

+37
-61
lines changed

CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ All notable changes to this project will be documented in this file, in reverse
2020

2121
- Nothing.
2222

23-
## 1.2.1 - TBD
23+
## 1.2.1 - 2016-07-07
2424

2525
### Added
2626

@@ -36,7 +36,10 @@ All notable changes to this project will be documented in this file, in reverse
3636

3737
### Fixed
3838

39-
- Nothing.
39+
- [#47](https://github.com/zfcampus/zf-api-problem/pull/47) fixes an issue with
40+
the various factories introduced in 1.2.0; they had been updated to implement the
41+
zend-servicemanager v3 interfaces, which broke usage with v2. They are now
42+
written in a way that will work with both versions.
4043

4144
## 1.2.0 - 2016-07-06
4245

src/Factory/ApiProblemListenerFactory.php

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,27 @@
11
<?php
2-
32
/**
43
* @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
5-
* @copyright Copyright (c) 2014 Zend Technologies USA Inc. (http://www.zend.com)
4+
* @copyright Copyright (c) 2014-2016 Zend Technologies USA Inc. (http://www.zend.com)
65
*/
76

87
namespace ZF\ApiProblem\Factory;
98

109
use Interop\Container\ContainerInterface;
11-
use Zend\ServiceManager\Factory\FactoryInterface;
1210
use ZF\ApiProblem\Listener\ApiProblemListener;
1311

14-
class ApiProblemListenerFactory implements FactoryInterface
12+
class ApiProblemListenerFactory
1513
{
1614
/**
17-
* @param \Interop\Container\ContainerInterface $container
18-
* @param string $requestedName
19-
* @param array|NULL $options
20-
*
21-
* @return \ZF\ApiProblem\Listener\ApiProblemListener
15+
* @param ContainerInterface $container
16+
* @return ApiProblemListener
2217
*/
23-
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
18+
public function __invoke(ContainerInterface $container)
2419
{
2520
$filters = null;
2621
$config = [];
2722

28-
if ($container->has('Config')) {
29-
$config = $container->get('Config');
23+
if ($container->has('config')) {
24+
$config = $container->get('config');
3025
}
3126

3227
if (isset($config['zf-api-problem']['accept_filters'])) {

src/Factory/ApiProblemRendererFactory.php

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,23 @@
11
<?php
2-
32
/**
43
* @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
5-
* @copyright Copyright (c) 2014 Zend Technologies USA Inc. (http://www.zend.com)
4+
* @copyright Copyright (c) 2014-2016 Zend Technologies USA Inc. (http://www.zend.com)
65
*/
76

87
namespace ZF\ApiProblem\Factory;
98

109
use Interop\Container\ContainerInterface;
11-
use Zend\ServiceManager\Factory\FactoryInterface;
1210
use ZF\ApiProblem\View\ApiProblemRenderer;
1311

14-
/**
15-
* Class ApiProblemRendererFactory.
16-
*/
17-
class ApiProblemRendererFactory implements FactoryInterface
12+
class ApiProblemRendererFactory
1813
{
1914
/**
20-
* @param \Interop\Container\ContainerInterface $container
21-
* @param string $requestedName
22-
* @param array|NULL $options
23-
*
24-
* @return \ZF\ApiProblem\View\ApiProblemRenderer
15+
* @param ContainerInterface $container
16+
* @return ApiProblemRenderer
2517
*/
26-
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
18+
public function __invoke(ContainerInterface $container)
2719
{
28-
$config = $container->get('Config');
20+
$config = $container->get('config');
2921
$displayExceptions = isset($config['view_manager'])
3022
&& isset($config['view_manager']['display_exceptions'])
3123
&& $config['view_manager']['display_exceptions'];

src/Factory/ApiProblemStrategyFactory.php

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,22 @@
11
<?php
2-
32
/**
43
* @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
5-
* @copyright Copyright (c) 2014 Zend Technologies USA Inc. (http://www.zend.com)
4+
* @copyright Copyright (c) 2014-2016 Zend Technologies USA Inc. (http://www.zend.com)
65
*/
76

87
namespace ZF\ApiProblem\Factory;
98

109
use Interop\Container\ContainerInterface;
11-
use Zend\ServiceManager\Factory\FactoryInterface;
1210
use ZF\ApiProblem\View\ApiProblemRenderer;
1311
use ZF\ApiProblem\View\ApiProblemStrategy;
1412

15-
/**
16-
* Class ApiProblemStrategyFactory.
17-
*/
18-
class ApiProblemStrategyFactory implements FactoryInterface
13+
class ApiProblemStrategyFactory
1914
{
2015
/**
21-
* @param \Interop\Container\ContainerInterface $container
22-
* @param string $requestedName
23-
* @param array|NULL $options
24-
*
25-
* @return \ZF\ApiProblem\View\ApiProblemStrategy
16+
* @param ContainerInterface $container
17+
* @return ApiProblemStrategy
2618
*/
27-
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
19+
public function __invoke(ContainerInterface $container)
2820
{
2921
return new ApiProblemStrategy($container->get(ApiProblemRenderer::class));
3022
}

src/Factory/RenderErrorListenerFactory.php

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,23 @@
11
<?php
2-
32
/**
43
* @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
5-
* @copyright Copyright (c) 2014 Zend Technologies USA Inc. (http://www.zend.com)
4+
* @copyright Copyright (c) 2014-2016 Zend Technologies USA Inc. (http://www.zend.com)
65
*/
76

87
namespace ZF\ApiProblem\Factory;
98

109
use Interop\Container\ContainerInterface;
11-
use Zend\ServiceManager\Factory\FactoryInterface;
1210
use ZF\ApiProblem\Listener\RenderErrorListener;
1311

14-
/**
15-
* Class RenderErrorListenerFactory.
16-
*/
17-
class RenderErrorListenerFactory implements FactoryInterface
12+
class RenderErrorListenerFactory
1813
{
1914
/**
20-
* @param \Interop\Container\ContainerInterface $container
21-
* @param string $requestedName
22-
* @param array|NULL $options
23-
*
24-
* @return \ZF\ApiProblem\Listener\RenderErrorListener
15+
* @param ContainerInterface $container
16+
* @return RenderErrorListener
2517
*/
26-
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
18+
public function __invoke(ContainerInterface $container)
2719
{
28-
$config = $container->get('Config');
20+
$config = $container->get('config');
2921
$displayExceptions = false;
3022

3123
if (isset($config['view_manager'])

src/Factory/SendApiProblemResponseListenerFactory.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
<?php
2-
32
/**
43
* @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
5-
* @copyright Copyright (c) 2014 Zend Technologies USA Inc. (http://www.zend.com)
4+
* @copyright Copyright (c) 2014-2016 Zend Technologies USA Inc. (http://www.zend.com)
65
*/
76

87
namespace ZF\ApiProblem\Factory;
98

109
use Interop\Container\ContainerInterface;
1110
use Zend\Http\Response as HttpResponse;
12-
use Zend\ServiceManager\Factory\FactoryInterface;
1311
use ZF\ApiProblem\Listener\SendApiProblemResponseListener;
1412

15-
class SendApiProblemResponseListenerFactory implements FactoryInterface
13+
class SendApiProblemResponseListenerFactory
1614
{
17-
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
15+
/**
16+
* @param ContainerInterface $container
17+
* @return SendApiProblemResponseListener
18+
*/
19+
public function __invoke(ContainerInterface $container)
1820
{
19-
$config = $container->get('Config');
21+
$config = $container->get('config');
2022
$displayExceptions = isset($config['view_manager'])
2123
&& isset($config['view_manager']['display_exceptions'])
2224
&& $config['view_manager']['display_exceptions'];

0 commit comments

Comments
 (0)