Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit ae15c2c

Browse files
committed
Merge branch 'feature/54' into develop
Close #54
2 parents 118d3bb + 8385832 commit ae15c2c

File tree

5 files changed

+22
-10
lines changed

5 files changed

+22
-10
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ for full details on how to migrate your v2 application.
7171
functionality related to exposing and configuring the zend-hydrator
7272
`HydratorManager`. That functionality is now exposed directly by the
7373
zend-hydrator component.
74+
- [#54](https://github.com/zendframework/zend-mvc/pull/54) removes the
75+
`$configuration` argument (first required argument) from the
76+
`Zend\Mvc\Application` constructor. If you were directly instantiating an
77+
`Application` instance previously (whether in your bootstrap, a factory, or
78+
tests), you will need to update how you instantiate the instance. (The
79+
argument was removed as the value was never used.)
7480

7581
### Fixed
7682

doc/book/migration/to-v3-0.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,21 @@ your application configuration. Components are pushed to the top of the module
3434
list, while modules are pushed to the end. As a development component, it will
3535
not be installed in your production distributions.
3636

37+
## Application class
38+
39+
The following changes were made to the `Zend\Mvc\Application` constructor:
40+
41+
- The first `$configuration` argument was removed, as it was not used.
42+
- Three additional, optional arguments were added:
43+
- `Zend\EventManager\EventManagerInterface $events = null`
44+
- `Zend\Stdlib\RequestInterface $request = null`
45+
- `Zend\Stdlib\ResponseInterface $response = null`
46+
47+
End-users using the skeleton application and the default `Application` factory
48+
will not notice a change. Those who are directly instantiating the `Application`
49+
instance (in production or test code) or who have created their own factory for
50+
the class will need to update their code.
51+
3752
## DI-ServiceManager integration
3853

3954
The integration between [zend-servicemanager](https://zendframework.github.io/zend-servicemanager) and

src/Application.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,6 @@ class Application implements
5656
const ERROR_ROUTER_NO_MATCH = 'error-router-no-match';
5757
const ERROR_MIDDLEWARE_CANNOT_DISPATCH = 'error-middleware-cannot-dispatch';
5858

59-
/**
60-
* @var array
61-
*/
62-
protected $configuration = null;
63-
6459
/**
6560
* Default application event listeners
6661
*
@@ -104,20 +99,17 @@ class Application implements
10499
/**
105100
* Constructor
106101
*
107-
* @param mixed $configuration
108102
* @param ServiceManager $serviceManager
109103
* @param null|EventManagerInterface $events
110104
* @param null|RequestInterface $request
111105
* @param null|ResponseInterface $response
112106
*/
113107
public function __construct(
114-
$configuration,
115108
ServiceManager $serviceManager,
116109
EventManagerInterface $events = null,
117110
RequestInterface $request = null,
118111
ResponseInterface $response = null
119112
) {
120-
$this->configuration = $configuration;
121113
$this->serviceManager = $serviceManager;
122114
$this->setEventManager($events ?: $serviceManager->get('EventManager'));
123115
$this->request = $request ?: $serviceManager->get('Request');

src/Service/ApplicationFactory.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ class ApplicationFactory implements FactoryInterface
3030
public function __invoke(ContainerInterface $container, $name, array $options = null)
3131
{
3232
return new Application(
33-
$container->get('config'),
3433
$container,
3534
$container->get('EventManager'),
3635
$container->get('Request'),

test/View/DefaultRendereringStrategyTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public function testTriggersRenderErrorEventInCaseOfRenderingException()
156156
],
157157
]))->configureServiceManager($services);
158158

159-
$application = new Application([], $services, $services->get('EventManager'), $this->request, $this->response);
159+
$application = new Application($services, $services->get('EventManager'), $this->request, $this->response);
160160
$this->event->setApplication($application);
161161

162162
$test = (object) ['flag' => false];

0 commit comments

Comments
 (0)