From 97693879821b50a540718a4a261736694135d9c2 Mon Sep 17 00:00:00 2001 From: Aleksei Khudiakov Date: Fri, 5 Jan 2018 16:27:32 +1000 Subject: [PATCH 1/2] Move Service namespace to Container namespace --- docs/book/intro.md | 6 +-- docs/book/services.md | 52 +++++++++---------- src/Application.php | 2 +- .../ApplicationFactory.php | 2 +- src/{Service => Container}/ConfigFactory.php | 2 +- .../ControllerManagerFactory.php | 2 +- .../ControllerPluginManagerFactory.php | 3 +- .../DefaultRenderingStrategyFactory.php} | 6 +-- .../DispatchListenerFactory.php | 2 +- .../EventManagerFactory.php | 2 +- .../ExceptionStrategyFactory.php} | 6 +-- .../HttpMethodListenerFactory.php | 2 +- .../HttpViewManagerFactory.php | 2 +- .../InjectTemplateListenerFactory.php | 2 +- .../ModuleManagerFactory.php | 2 +- .../PaginatorPluginManagerFactory.php | 3 +- src/{Service => Container}/RequestFactory.php | 2 +- .../ResponseFactory.php | 2 +- .../RouteNotFoundStrategyFactory.php} | 6 +-- .../SendResponseListenerFactory.php | 2 +- .../ServiceListenerFactory.php | 44 ++++++++-------- .../ServiceManagerConfig.php | 2 +- src/{Service => Container}/ViewFactory.php | 2 +- .../ViewFeedStrategyFactory.php | 2 +- .../ViewHelperManagerFactory.php | 3 +- .../ViewJsonStrategyFactory.php | 2 +- .../ViewManagerConfigTrait.php} | 4 +- .../ViewManagerFactory.php | 2 +- .../ViewPhpRendererFactory.php | 2 +- .../ViewPhpRendererStrategyFactory.php | 2 +- .../ViewPrefixPathStackResolverFactory.php | 2 +- .../ViewResolverFactory.php | 2 +- .../ViewTemplateMapResolverFactory.php | 2 +- .../ViewTemplatePathStackFactory.php | 2 +- test/Application/BadControllerTrait.php | 4 +- .../InvalidControllerTypeTrait.php | 4 +- test/Application/MissingControllerTrait.php | 4 +- test/Application/PathControllerTrait.php | 4 +- .../Application/config/module.config.php | 2 +- test/ApplicationTest.php | 4 +- .../ControllerManagerFactoryTest.php | 9 ++-- .../HttpMethodListenerFactoryTest.php | 6 +-- .../InjectTemplateListenerFactoryTest.php | 8 +-- .../RequestFactoryTest.php | 4 +- .../ResponseFactoryTest.php | 4 +- .../SendResponseListenerFactoryTest.php | 4 +- .../ServiceListenerFactoryTest.php | 6 +-- .../ServiceManagerConfigTest.php | 8 ++- .../ViewFeedStrategyFactoryTest.php | 4 +- .../ViewHelperManagerFactoryTest.php | 4 +- .../ViewJsonStrategyFactoryTest.php | 4 +- .../ViewManagerFactoryTest.php | 4 +- ...ViewPrefixPathStackResolverFactoryTest.php | 4 +- 53 files changed, 136 insertions(+), 136 deletions(-) rename src/{Service => Container}/ApplicationFactory.php (97%) rename src/{Service => Container}/ConfigFactory.php (97%) rename src/{Service => Container}/ControllerManagerFactory.php (97%) rename src/{Service => Container}/ControllerPluginManagerFactory.php (86%) rename src/{Service/HttpDefaultRenderingStrategyFactory.php => Container/DefaultRenderingStrategyFactory.php} (91%) rename src/{Service => Container}/DispatchListenerFactory.php (96%) rename src/{Service => Container}/EventManagerFactory.php (97%) rename src/{Service/HttpExceptionStrategyFactory.php => Container/ExceptionStrategyFactory.php} (93%) rename src/{Service => Container}/HttpMethodListenerFactory.php (97%) rename src/{Service => Container}/HttpViewManagerFactory.php (96%) rename src/{Service => Container}/InjectTemplateListenerFactory.php (97%) rename src/{Service => Container}/ModuleManagerFactory.php (99%) rename src/{Service => Container}/PaginatorPluginManagerFactory.php (86%) rename src/{Service => Container}/RequestFactory.php (96%) rename src/{Service => Container}/ResponseFactory.php (96%) rename src/{Service/HttpRouteNotFoundStrategyFactory.php => Container/RouteNotFoundStrategyFactory.php} (94%) rename src/{Service => Container}/SendResponseListenerFactory.php (95%) rename src/{Service => Container}/ServiceListenerFactory.php (83%) rename src/{Service => Container}/ServiceManagerConfig.php (99%) rename src/{Service => Container}/ViewFactory.php (96%) rename src/{Service => Container}/ViewFeedStrategyFactory.php (97%) rename src/{Service => Container}/ViewHelperManagerFactory.php (98%) rename src/{Service => Container}/ViewJsonStrategyFactory.php (97%) rename src/{Service/HttpViewManagerConfigTrait.php => Container/ViewManagerConfigTrait.php} (93%) rename src/{Service => Container}/ViewManagerFactory.php (96%) rename src/{Service => Container}/ViewPhpRendererFactory.php (96%) rename src/{Service => Container}/ViewPhpRendererStrategyFactory.php (96%) rename src/{Service => Container}/ViewPrefixPathStackResolverFactory.php (97%) rename src/{Service => Container}/ViewResolverFactory.php (98%) rename src/{Service => Container}/ViewTemplateMapResolverFactory.php (97%) rename src/{Service => Container}/ViewTemplatePathStackFactory.php (98%) rename test/{Service => Container}/ControllerManagerFactoryTest.php (94%) rename test/{Service => Container}/HttpMethodListenerFactoryTest.php (92%) rename test/{Service => Container}/InjectTemplateListenerFactoryTest.php (91%) rename test/{Service => Container}/RequestFactoryTest.php (90%) rename test/{Service => Container}/ResponseFactoryTest.php (90%) rename test/{Service => Container}/SendResponseListenerFactoryTest.php (96%) rename test/{Service => Container}/ServiceListenerFactoryTest.php (98%) rename test/{Service => Container}/ServiceManagerConfigTest.php (96%) rename test/{Service => Container}/ViewFeedStrategyFactoryTest.php (92%) rename test/{Service => Container}/ViewHelperManagerFactoryTest.php (98%) rename test/{Service => Container}/ViewJsonStrategyFactoryTest.php (92%) rename test/{Service => Container}/ViewManagerFactoryTest.php (93%) rename test/{Service => Container}/ViewPrefixPathStackResolverFactoryTest.php (92%) diff --git a/docs/book/intro.md b/docs/book/intro.md index 178e64aea..859635af2 100644 --- a/docs/book/intro.md +++ b/docs/book/intro.md @@ -25,7 +25,7 @@ Within the MVC layer, several sub-components are exposed: - `Zend\Mvc\Controller`, a set of abstract "controller" classes with basic responsibilities such as event wiring, action dispatching, etc., as well as controller plugins. -- `Zend\Mvc\Service` provides a set of zend-servicemanager factories and +- `Zend\Mvc\Container` provides a set of zend-servicemanager factories and definitions for the default application workflow. - `Zend\Mvc\View` provides default wiring for renderer selection, view script resolution, helper registration, and more; additionally, it provides a @@ -271,7 +271,7 @@ services available by default yet. You can greatly simplify things by using the ```php use Zend\Loader\AutoloaderFactory; -use Zend\Mvc\Service\ServiceManagerConfig; +use Zend\Mvc\Container\ServiceManagerConfig; use Zend\ServiceManager\ServiceManager; // setup autoloader @@ -300,7 +300,7 @@ You can make this even simpler by using the `init()` method of the ```php use Zend\Loader\AutoloaderFactory; use Zend\Mvc\Application; -use Zend\Mvc\Service\ServiceManagerConfig; +use Zend\Mvc\Container\ServiceManagerConfig; use Zend\ServiceManager\ServiceManager; // setup autoloader diff --git a/docs/book/services.md b/docs/book/services.md index 1e3a82e66..5cd543c7b 100644 --- a/docs/book/services.md +++ b/docs/book/services.md @@ -1,7 +1,7 @@ # Default Services The default and recommended way to write zend-mvc applications uses a set of -services defined in the `Zend\Mvc\Service` namespace. This chapter details what +services defined in the `Zend\Mvc\Container` namespace. This chapter details what each of those services are, the classes they represent, and the configuration options available. @@ -17,17 +17,17 @@ somewhat complex set of services and their factories has been created. We'll try to give a simplified explanation of the process. When a `Zend\Mvc\Application` is created, a `Zend\ServiceManager\ServiceManager` -object is created and configured via `Zend\Mvc\Service\ServiceManagerConfig`. +object is created and configured via `Zend\Mvc\Container\ServiceManagerConfig`. The `ServiceManagerConfig` gets the configuration from `config/application.config.php` (or some other application configuration you passed to the `Application` when creating it). From all the service and -factories provided in the `Zend\Mvc\Service` namespace, `ServiceManagerConfig` +factories provided in the `Zend\Mvc\Container` namespace, `ServiceManagerConfig` is responsible of configuring only three: `SharedEventManager`, `EventManager`, and `ModuleManager`. After this, the `Application` fetches the `ModuleManager`. At this point, the `ModuleManager` further configures the `ServiceManager` with services and -factories provided in `Zend\Mvc\Service\ServiceListenerFactory`. This approach +factories provided in `Zend\Mvc\Container\ServiceListenerFactory`. This approach allows us to keep the main application configuration concise, and to give the developer the power to configure different parts of the MVC system from within the modules, overriding any default configuration in these MVC services. @@ -84,14 +84,14 @@ services configured out of the box. ### Factories -- `Application`, mapping to `Zend\Mvc\Service\ApplicationFactory`. +- `Application`, mapping to `Zend\Mvc\Container\ApplicationFactory`. -- `Config`, mapping to `Zend\Mvc\Service\ConfigFactory`. Internally, this +- `Config`, mapping to `Zend\Mvc\Container\ConfigFactory`. Internally, this pulls the `ModuleManager` service, calls its `loadModules()` method, and retrieves the merged configuration from the module event. As such, this service contains the entire, merged application configuration. -- `ControllerManager`, mapping to `Zend\Mvc\Service\ControllerLoaderFactory`. +- `ControllerManager`, mapping to `Zend\Mvc\Container\ControllerManagerFactory`. This creates an instance of `Zend\Mvc\Controller\ControllerManager`, passing the service manager instance. Additionally, it uses the `DiStrictAbstractServiceFactory` service, effectively allowing you to fall @@ -112,7 +112,7 @@ services configured out of the box. service, as long as the `setPluginManager` method is implemented. - `ControllerPluginManager`, mapping to - `Zend\Mvc\Service\ControllerPluginManagerFactory`. This instantiates the + `Zend\Mvc\Container\ControllerPluginManagerFactory`. This instantiates the `Zend\Mvc\Controller\PluginManager` instance, passing it the service manager instance. It also uses the `DiAbstractServiceFactory` service, effectively allowing you to fall back to DI in order to retrieve your [controller plugins](plugins.md). @@ -158,13 +158,13 @@ services configured out of the box. This creates an instance of `Zend\Mvc\Service\DiStrictAbstractServiceFactoryFactory`, injecting the `Di` service instance. -- `EventManager`, mapping to `Zend\Mvc\Service\EventManagerFactory`. This +- `EventManager`, mapping to `Zend\Mvc\Container\EventManagerFactory`. This factory returns a *discrete* instance of `Zend\EventManager\EventManager` on each request. This service is not shared by default, allowing the ability to have an `EventManager` per service, with a shared `SharedEventManager` injected in each. -- `FilterManager`, mapping to `Zend\Mvc\Service\FilterManagerFactory`. This +- `FilterManager`, mapping to `Zend\Mvc\Container\FilterManagerFactory`. This instantiates the `Zend\Filter\FilterPluginManager` instance, passing it the service manager instance; this is used to manage filters for [filter chains](http://docs.zendframework.com/zend-filter/filter-chains/). It also uses the `DiAbstractServiceFactory` service, effectively allowing @@ -180,7 +180,7 @@ services configured out of the box. the `Config` service, and pulls from the `router` key, configuring a `Zend\Router\Http\TreeRouteStack` instance. -- `HttpViewManager`, mapping to `Zend\Mvc\Service\HttpViewManagerFactory`. +- `HttpViewManager`, mapping to `Zend\Mvc\Container\HttpViewManagerFactory`. This creates and returns an instance of `Zend\Mvc\View\Http\ViewManager`, which in turn registers and initializes a number of HTTP-specific view services. @@ -193,14 +193,14 @@ services configured out of the box. This creates and returns an instance of `Zend\InputFilter\InputFilterPluginManager`, which can be used to manage and persist input filter instances. -- `ModuleManager`, mapping to `Zend\Mvc\Service\ModuleManagerFactory`. This is +- `ModuleManager`, mapping to `Zend\Mvc\Container\ModuleManagerFactory`. This is perhaps the most complex factory in the MVC stack. It expects that an `ApplicationConfig` service has been injected, with keys for `module_listener_options` and `modules`; see the quick start for samples. It creates an instance of `Zend\ModuleManager\Listener\DefaultListenerAggregate`, using the `module_listener_options` retrieved. It then checks if a service with the name `ServiceListener` exists; if not, it sets a factory with that - name mapping to `Zend\Mvc\Service\ServiceListenerFactory`. A bunch of + name mapping to `Zend\Mvc\Container\ServiceListenerFactory`. A bunch of service listeners will be added to the `ServiceListener`, like listeners for the `getServiceConfig`, `getControllerConfig`, `getControllerPluginConfig`, and `getViewHelperConfig` module methods. Next, it retrieves the @@ -216,20 +216,20 @@ services configured out of the box. allowing the instance to be used anywhere a translator may be required in the framework. -- `PaginatorPluginManager`, mapping to `Zend\Mvc\Service\PaginatorPluginManagerFactory`. +- `PaginatorPluginManager`, mapping to `Zend\Mvc\Container\PaginatorPluginManagerFactory`. This instantiates the `Zend\Paginator\AdapterPluginManager` instance, passing it the service manager instance. This is used to manage [paginator adapters](https://docs.zendframework.com/zend-paginator/advanced/#custom-data-source-adapters). It also uses the `DiAbstractServiceFactory` service, effectively allowing you to fall back to DI in order to retrieve paginator adapters. -- `Request`, mapping to `Zend\Mvc\Service\RequestFactory`. The factory is used +- `Request`, mapping to `Zend\Mvc\Container\RequestFactory`. The factory is used to create and return a request instance, according to the current environment. If the current environment is a console environment, it will create a `Zend\Console\Request`; otherwise, for HTTP environments, it creates a `Zend\Http\PhpEnvironment\Request`. -- `Response`, mapping to `Zend\Mvc\Service\ResponseFactory`. The factory is +- `Response`, mapping to `Zend\Mvc\Container\ResponseFactory`. The factory is used to create and return a response instance, according to the current environment. If the current environment is a console environment, it will create a `Zend\Console\Response`; otherwise, for HTTP environments, it @@ -249,7 +249,7 @@ services configured out of the box. which returns an instance of `Zend\Serializer\AdapterPluginManager`. This is a plugin manager for managing serializer adapter instances. -- `ServiceListener`, mapping to `Zend\Mvc\Service\ServiceListenerFactory`. The +- `ServiceListener`, mapping to `Zend\Mvc\Container\ServiceListenerFactory`. The factory is used to instantiate the `ServiceListener`, while allowing easy extending. It checks if a service with the name `ServiceListenerInterface` exists, which must implement `Zend\ModuleManager\Listener\ServiceListenerInterface`, @@ -266,15 +266,15 @@ services configured out of the box. It also uses the `DiAbstractServiceFactory` service, effectively allowing you to fall back to DI in order to retrieve validators. -- `ViewFeedRenderer`, mapping to `Zend\Mvc\Service\ViewFeedRendererFactory`, +- `ViewFeedRenderer`, mapping to `Zend\Mvc\Container\ViewFeedRendererFactory`, which returns an instance of `Zend\View\Renderer\FeedRenderer`, used to render feeds. -- `ViewFeedStrategy`, mapping to `Zend\Mvc\Service\ViewFeedStrategyFactory`, +- `ViewFeedStrategy`, mapping to `Zend\Mvc\Container\ViewFeedStrategyFactory`, which returns an instance of `Zend\View\Strategy\FeedStrategy`, used to select the `ViewFeedRenderer` given the appropriate criteria. -- `ViewHelperManager`, mapping to `Zend\Mvc\Service\ViewHelperManagerFactory`, +- `ViewHelperManager`, mapping to `Zend\Mvc\Container\ViewHelperManagerFactory`, which returns an instance of `Zend\View\HelperManager`. This is a plugin manager for managing view helper instances. @@ -282,24 +282,24 @@ services configured out of the box. which returns an instance of `Zend\View\Renderer\JsonRenderer`, used to render JSON structures. -- `ViewJsonStrategy`, mapping to `Zend\Mvc\Service\ViewJsonStrategyFactory`, +- `ViewJsonStrategy`, mapping to `Zend\Mvc\Container\ViewJsonStrategyFactory`, which returns an instance of `Zend\View\Strategy\JsonStrategy`, used to select the `ViewJsonRenderer` given the appropriate criteria. -- `ViewManager`, mapping to `Zend\Mvc\Service\ViewManagerFactory`. The factory +- `ViewManager`, mapping to `Zend\Mvc\Container\ViewManagerFactory`. The factory is used to create and return a view manager, according to the current environment. If the current environment is a console environment, it will create a `Zend\Mvc\View\Console\ViewManager`; otherwise, for HTTP environments, it returns a `Zend\Mvc\View\Http\ViewManager`. -- `ViewResolver`, mapping to `Zend\Mvc\Service\ViewResolverFactory`, which +- `ViewResolver`, mapping to `Zend\Mvc\Container\ViewResolverFactory`, which creates and returns the aggregate view resolver. It also attaches the `ViewTemplateMapResolver` and `ViewTemplatePathStack` services to it. -- `ViewTemplateMapResolver`, mapping to `Zend\Mvc\Service\ViewTemplateMapResolverFactory`, +- `ViewTemplateMapResolver`, mapping to `Zend\Mvc\Container\ViewTemplateMapResolverFactory`, which creates, configures and returns the `Zend\View\Resolver\TemplateMapResolver`. -- `ViewTemplatePathStack`, mapping to `Zend\Mvc\Service\ViewTemplatePathStackFactory`, +- `ViewTemplatePathStack`, mapping to `Zend\Mvc\Container\ViewTemplatePathStackFactory`, which creates, configures and returns the `Zend\View\Resolver\TemplatePathStack`. ### Abstract factories @@ -519,7 +519,7 @@ created and managed by the `ViewManager`: - `ViewHelperManager`, representing and aliased to `Zend\View\HelperPluginManager`. It is seeded with the `ServiceManager`. Created via the - `Zend\Mvc\Service\ViewHelperManagerFactory`. + `Zend\Mvc\Container\ViewHelperManagerFactory`. - The `Router` service is retrieved, and injected into the `Url` helper. diff --git a/src/Application.php b/src/Application.php index cc66cbb22..085af9f75 100644 --- a/src/Application.php +++ b/src/Application.php @@ -252,7 +252,7 @@ public static function init($configuration = []) { // Prepare the service manager $smConfig = isset($configuration['service_manager']) ? $configuration['service_manager'] : []; - $smConfig = new Service\ServiceManagerConfig($smConfig); + $smConfig = new Container\ServiceManagerConfig($smConfig); $serviceManager = new ServiceManager(); $smConfig->configureServiceManager($serviceManager); diff --git a/src/Service/ApplicationFactory.php b/src/Container/ApplicationFactory.php similarity index 97% rename from src/Service/ApplicationFactory.php rename to src/Container/ApplicationFactory.php index 2871cc334..6af06f338 100644 --- a/src/Service/ApplicationFactory.php +++ b/src/Container/ApplicationFactory.php @@ -5,7 +5,7 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\Mvc\Application; diff --git a/src/Service/ConfigFactory.php b/src/Container/ConfigFactory.php similarity index 97% rename from src/Service/ConfigFactory.php rename to src/Container/ConfigFactory.php index 4b9fbcbe6..1b92f2ff2 100644 --- a/src/Service/ConfigFactory.php +++ b/src/Container/ConfigFactory.php @@ -5,7 +5,7 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Traversable; diff --git a/src/Service/ControllerManagerFactory.php b/src/Container/ControllerManagerFactory.php similarity index 97% rename from src/Service/ControllerManagerFactory.php rename to src/Container/ControllerManagerFactory.php index a1dd50812..29157efd0 100644 --- a/src/Service/ControllerManagerFactory.php +++ b/src/Container/ControllerManagerFactory.php @@ -5,7 +5,7 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\Mvc\Controller\ControllerManager; diff --git a/src/Service/ControllerPluginManagerFactory.php b/src/Container/ControllerPluginManagerFactory.php similarity index 86% rename from src/Service/ControllerPluginManagerFactory.php rename to src/Container/ControllerPluginManagerFactory.php index 3b5c5a5fe..7b4278d1a 100644 --- a/src/Service/ControllerPluginManagerFactory.php +++ b/src/Container/ControllerPluginManagerFactory.php @@ -5,9 +5,10 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Zend\Mvc\Controller\PluginManager as ControllerPluginManager; +use Zend\Mvc\Service\AbstractPluginManagerFactory; class ControllerPluginManagerFactory extends AbstractPluginManagerFactory { diff --git a/src/Service/HttpDefaultRenderingStrategyFactory.php b/src/Container/DefaultRenderingStrategyFactory.php similarity index 91% rename from src/Service/HttpDefaultRenderingStrategyFactory.php rename to src/Container/DefaultRenderingStrategyFactory.php index 21a47daae..bc2302a8b 100644 --- a/src/Service/HttpDefaultRenderingStrategyFactory.php +++ b/src/Container/DefaultRenderingStrategyFactory.php @@ -5,16 +5,16 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\Mvc\View\Http\DefaultRenderingStrategy; use Zend\ServiceManager\Factory\FactoryInterface; use Zend\View\View; -class HttpDefaultRenderingStrategyFactory implements FactoryInterface +class DefaultRenderingStrategyFactory implements FactoryInterface { - use HttpViewManagerConfigTrait; + use ViewManagerConfigTrait; /** * @param ContainerInterface $container diff --git a/src/Service/DispatchListenerFactory.php b/src/Container/DispatchListenerFactory.php similarity index 96% rename from src/Service/DispatchListenerFactory.php rename to src/Container/DispatchListenerFactory.php index 5d4aa99f5..1ee3e09de 100644 --- a/src/Service/DispatchListenerFactory.php +++ b/src/Container/DispatchListenerFactory.php @@ -5,7 +5,7 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\Mvc\DispatchListener; diff --git a/src/Service/EventManagerFactory.php b/src/Container/EventManagerFactory.php similarity index 97% rename from src/Service/EventManagerFactory.php rename to src/Container/EventManagerFactory.php index 98bc186a6..f6e94ef07 100644 --- a/src/Service/EventManagerFactory.php +++ b/src/Container/EventManagerFactory.php @@ -5,7 +5,7 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\EventManager\EventManager; diff --git a/src/Service/HttpExceptionStrategyFactory.php b/src/Container/ExceptionStrategyFactory.php similarity index 93% rename from src/Service/HttpExceptionStrategyFactory.php rename to src/Container/ExceptionStrategyFactory.php index 6798f5a0a..3ad30ece1 100644 --- a/src/Service/HttpExceptionStrategyFactory.php +++ b/src/Container/ExceptionStrategyFactory.php @@ -5,15 +5,15 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\Mvc\View\Http\ExceptionStrategy; use Zend\ServiceManager\Factory\FactoryInterface; -class HttpExceptionStrategyFactory implements FactoryInterface +class ExceptionStrategyFactory implements FactoryInterface { - use HttpViewManagerConfigTrait; + use ViewManagerConfigTrait; /** * @param ContainerInterface $container diff --git a/src/Service/HttpMethodListenerFactory.php b/src/Container/HttpMethodListenerFactory.php similarity index 97% rename from src/Service/HttpMethodListenerFactory.php rename to src/Container/HttpMethodListenerFactory.php index 7562ac9b8..72cf82f57 100644 --- a/src/Service/HttpMethodListenerFactory.php +++ b/src/Container/HttpMethodListenerFactory.php @@ -5,7 +5,7 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\Mvc\HttpMethodListener; diff --git a/src/Service/HttpViewManagerFactory.php b/src/Container/HttpViewManagerFactory.php similarity index 96% rename from src/Service/HttpViewManagerFactory.php rename to src/Container/HttpViewManagerFactory.php index 07745e372..1336c6080 100644 --- a/src/Service/HttpViewManagerFactory.php +++ b/src/Container/HttpViewManagerFactory.php @@ -5,7 +5,7 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\Mvc\View\Http\ViewManager as HttpViewManager; diff --git a/src/Service/InjectTemplateListenerFactory.php b/src/Container/InjectTemplateListenerFactory.php similarity index 97% rename from src/Service/InjectTemplateListenerFactory.php rename to src/Container/InjectTemplateListenerFactory.php index effd137a3..9aa66e9c5 100644 --- a/src/Service/InjectTemplateListenerFactory.php +++ b/src/Container/InjectTemplateListenerFactory.php @@ -5,7 +5,7 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\Mvc\View\Http\InjectTemplateListener; diff --git a/src/Service/ModuleManagerFactory.php b/src/Container/ModuleManagerFactory.php similarity index 99% rename from src/Service/ModuleManagerFactory.php rename to src/Container/ModuleManagerFactory.php index 2d50ea820..de8bee354 100644 --- a/src/Service/ModuleManagerFactory.php +++ b/src/Container/ModuleManagerFactory.php @@ -5,7 +5,7 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\ModuleManager\Listener\DefaultListenerAggregate; diff --git a/src/Service/PaginatorPluginManagerFactory.php b/src/Container/PaginatorPluginManagerFactory.php similarity index 86% rename from src/Service/PaginatorPluginManagerFactory.php rename to src/Container/PaginatorPluginManagerFactory.php index eac7de893..44f15c42b 100644 --- a/src/Service/PaginatorPluginManagerFactory.php +++ b/src/Container/PaginatorPluginManagerFactory.php @@ -5,8 +5,9 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; +use Zend\Mvc\Service\AbstractPluginManagerFactory; use Zend\Paginator\AdapterPluginManager as PaginatorPluginManager; class PaginatorPluginManagerFactory extends AbstractPluginManagerFactory diff --git a/src/Service/RequestFactory.php b/src/Container/RequestFactory.php similarity index 96% rename from src/Service/RequestFactory.php rename to src/Container/RequestFactory.php index df3f39aee..c16fc8356 100644 --- a/src/Service/RequestFactory.php +++ b/src/Container/RequestFactory.php @@ -5,7 +5,7 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\Http\PhpEnvironment\Request as HttpRequest; diff --git a/src/Service/ResponseFactory.php b/src/Container/ResponseFactory.php similarity index 96% rename from src/Service/ResponseFactory.php rename to src/Container/ResponseFactory.php index ff917299c..c6751b964 100644 --- a/src/Service/ResponseFactory.php +++ b/src/Container/ResponseFactory.php @@ -5,7 +5,7 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\Http\PhpEnvironment\Response as HttpResponse; diff --git a/src/Service/HttpRouteNotFoundStrategyFactory.php b/src/Container/RouteNotFoundStrategyFactory.php similarity index 94% rename from src/Service/HttpRouteNotFoundStrategyFactory.php rename to src/Container/RouteNotFoundStrategyFactory.php index a426d1aea..964873d08 100644 --- a/src/Service/HttpRouteNotFoundStrategyFactory.php +++ b/src/Container/RouteNotFoundStrategyFactory.php @@ -5,15 +5,15 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\Mvc\View\Http\RouteNotFoundStrategy; use Zend\ServiceManager\Factory\FactoryInterface; -class HttpRouteNotFoundStrategyFactory implements FactoryInterface +class RouteNotFoundStrategyFactory implements FactoryInterface { - use HttpViewManagerConfigTrait; + use ViewManagerConfigTrait; /** * @param ContainerInterface $container diff --git a/src/Service/SendResponseListenerFactory.php b/src/Container/SendResponseListenerFactory.php similarity index 95% rename from src/Service/SendResponseListenerFactory.php rename to src/Container/SendResponseListenerFactory.php index c94b559af..215dddb36 100644 --- a/src/Service/SendResponseListenerFactory.php +++ b/src/Container/SendResponseListenerFactory.php @@ -5,7 +5,7 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\Mvc\SendResponseListener; diff --git a/src/Service/ServiceListenerFactory.php b/src/Container/ServiceListenerFactory.php similarity index 83% rename from src/Service/ServiceListenerFactory.php rename to src/Container/ServiceListenerFactory.php index 4416fb6e8..17d471419 100644 --- a/src/Service/ServiceListenerFactory.php +++ b/src/Container/ServiceListenerFactory.php @@ -5,7 +5,7 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\ModuleManager\Listener\ServiceListener; @@ -62,27 +62,27 @@ class ServiceListenerFactory implements FactoryInterface 'invokables' => [], 'factories' => [ 'Application' => ApplicationFactory::class, - 'config' => 'Zend\Mvc\Service\ConfigFactory', - 'ControllerManager' => 'Zend\Mvc\Service\ControllerManagerFactory', - 'ControllerPluginManager' => 'Zend\Mvc\Service\ControllerPluginManagerFactory', - 'DispatchListener' => 'Zend\Mvc\Service\DispatchListenerFactory', - 'HttpExceptionStrategy' => HttpExceptionStrategyFactory::class, - 'HttpMethodListener' => 'Zend\Mvc\Service\HttpMethodListenerFactory', - 'HttpRouteNotFoundStrategy' => HttpRouteNotFoundStrategyFactory::class, - 'HttpViewManager' => 'Zend\Mvc\Service\HttpViewManagerFactory', - 'InjectTemplateListener' => 'Zend\Mvc\Service\InjectTemplateListenerFactory', - 'PaginatorPluginManager' => 'Zend\Mvc\Service\PaginatorPluginManagerFactory', - 'Request' => 'Zend\Mvc\Service\RequestFactory', - 'Response' => 'Zend\Mvc\Service\ResponseFactory', - 'ViewHelperManager' => 'Zend\Mvc\Service\ViewHelperManagerFactory', - View\Http\DefaultRenderingStrategy::class => HttpDefaultRenderingStrategyFactory::class, - 'ViewFeedStrategy' => 'Zend\Mvc\Service\ViewFeedStrategyFactory', - 'ViewJsonStrategy' => 'Zend\Mvc\Service\ViewJsonStrategyFactory', - 'ViewManager' => 'Zend\Mvc\Service\ViewManagerFactory', - 'ViewResolver' => 'Zend\Mvc\Service\ViewResolverFactory', - 'ViewTemplateMapResolver' => 'Zend\Mvc\Service\ViewTemplateMapResolverFactory', - 'ViewTemplatePathStack' => 'Zend\Mvc\Service\ViewTemplatePathStackFactory', - 'ViewPrefixPathStackResolver' => 'Zend\Mvc\Service\ViewPrefixPathStackResolverFactory', + 'config' => 'Zend\Mvc\Container\ConfigFactory', + 'ControllerManager' => 'Zend\Mvc\Container\ControllerManagerFactory', + 'ControllerPluginManager' => 'Zend\Mvc\Container\ControllerPluginManagerFactory', + 'DispatchListener' => 'Zend\Mvc\Container\DispatchListenerFactory', + 'HttpExceptionStrategy' => ExceptionStrategyFactory::class, + 'HttpMethodListener' => 'Zend\Mvc\Container\HttpMethodListenerFactory', + 'HttpRouteNotFoundStrategy' => RouteNotFoundStrategyFactory::class, + 'HttpViewManager' => 'Zend\Mvc\Container\HttpViewManagerFactory', + 'InjectTemplateListener' => 'Zend\Mvc\Container\InjectTemplateListenerFactory', + 'PaginatorPluginManager' => 'Zend\Mvc\Container\PaginatorPluginManagerFactory', + 'Request' => 'Zend\Mvc\Container\RequestFactory', + 'Response' => 'Zend\Mvc\Container\ResponseFactory', + 'ViewHelperManager' => 'Zend\Mvc\Container\ViewHelperManagerFactory', + View\Http\DefaultRenderingStrategy::class => DefaultRenderingStrategyFactory::class, + 'ViewFeedStrategy' => 'Zend\Mvc\Container\ViewFeedStrategyFactory', + 'ViewJsonStrategy' => 'Zend\Mvc\Container\ViewJsonStrategyFactory', + 'ViewManager' => 'Zend\Mvc\Container\ViewManagerFactory', + 'ViewResolver' => 'Zend\Mvc\Container\ViewResolverFactory', + 'ViewTemplateMapResolver' => 'Zend\Mvc\Container\ViewTemplateMapResolverFactory', + 'ViewTemplatePathStack' => 'Zend\Mvc\Container\ViewTemplatePathStackFactory', + 'ViewPrefixPathStackResolver' => 'Zend\Mvc\Container\ViewPrefixPathStackResolverFactory', 'Zend\Mvc\MiddlewareListener' => InvokableFactory::class, 'Zend\Mvc\RouteListener' => InvokableFactory::class, 'Zend\Mvc\SendResponseListener' => SendResponseListenerFactory::class, diff --git a/src/Service/ServiceManagerConfig.php b/src/Container/ServiceManagerConfig.php similarity index 99% rename from src/Service/ServiceManagerConfig.php rename to src/Container/ServiceManagerConfig.php index dc1073a4e..9cdee66ad 100644 --- a/src/Service/ServiceManagerConfig.php +++ b/src/Container/ServiceManagerConfig.php @@ -5,7 +5,7 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\EventManager\EventManager; diff --git a/src/Service/ViewFactory.php b/src/Container/ViewFactory.php similarity index 96% rename from src/Service/ViewFactory.php rename to src/Container/ViewFactory.php index ed5852752..2fa90ed7c 100644 --- a/src/Service/ViewFactory.php +++ b/src/Container/ViewFactory.php @@ -5,7 +5,7 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\ServiceManager\Factory\FactoryInterface; diff --git a/src/Service/ViewFeedStrategyFactory.php b/src/Container/ViewFeedStrategyFactory.php similarity index 97% rename from src/Service/ViewFeedStrategyFactory.php rename to src/Container/ViewFeedStrategyFactory.php index 61a0d6c1a..7b3eefb8f 100644 --- a/src/Service/ViewFeedStrategyFactory.php +++ b/src/Container/ViewFeedStrategyFactory.php @@ -5,7 +5,7 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\ServiceManager\Factory\FactoryInterface; diff --git a/src/Service/ViewHelperManagerFactory.php b/src/Container/ViewHelperManagerFactory.php similarity index 98% rename from src/Service/ViewHelperManagerFactory.php rename to src/Container/ViewHelperManagerFactory.php index 371885b19..e1781b668 100644 --- a/src/Service/ViewHelperManagerFactory.php +++ b/src/Container/ViewHelperManagerFactory.php @@ -5,9 +5,10 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; +use Zend\Mvc\Service\AbstractPluginManagerFactory; use Zend\Router\RouteMatch; use Zend\ServiceManager\Exception\ServiceNotCreatedException; use Zend\View\Helper as ViewHelper; diff --git a/src/Service/ViewJsonStrategyFactory.php b/src/Container/ViewJsonStrategyFactory.php similarity index 97% rename from src/Service/ViewJsonStrategyFactory.php rename to src/Container/ViewJsonStrategyFactory.php index 1f5615031..acbc4b26c 100644 --- a/src/Service/ViewJsonStrategyFactory.php +++ b/src/Container/ViewJsonStrategyFactory.php @@ -5,7 +5,7 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\ServiceManager\Factory\FactoryInterface; diff --git a/src/Service/HttpViewManagerConfigTrait.php b/src/Container/ViewManagerConfigTrait.php similarity index 93% rename from src/Service/HttpViewManagerConfigTrait.php rename to src/Container/ViewManagerConfigTrait.php index 6c6efa62d..81da41c0d 100644 --- a/src/Service/HttpViewManagerConfigTrait.php +++ b/src/Container/ViewManagerConfigTrait.php @@ -5,12 +5,12 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use ArrayAccess; use Interop\Container\ContainerInterface; -trait HttpViewManagerConfigTrait +trait ViewManagerConfigTrait { /** * Retrieve view_manager configuration, if present. diff --git a/src/Service/ViewManagerFactory.php b/src/Container/ViewManagerFactory.php similarity index 96% rename from src/Service/ViewManagerFactory.php rename to src/Container/ViewManagerFactory.php index 28c1ecb76..81d2bc2bd 100644 --- a/src/Service/ViewManagerFactory.php +++ b/src/Container/ViewManagerFactory.php @@ -5,7 +5,7 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\Mvc\View\Http\ViewManager as HttpViewManager; diff --git a/src/Service/ViewPhpRendererFactory.php b/src/Container/ViewPhpRendererFactory.php similarity index 96% rename from src/Service/ViewPhpRendererFactory.php rename to src/Container/ViewPhpRendererFactory.php index 3cd3d836b..13ea74d99 100644 --- a/src/Service/ViewPhpRendererFactory.php +++ b/src/Container/ViewPhpRendererFactory.php @@ -5,7 +5,7 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\ServiceManager\Factory\FactoryInterface; diff --git a/src/Service/ViewPhpRendererStrategyFactory.php b/src/Container/ViewPhpRendererStrategyFactory.php similarity index 96% rename from src/Service/ViewPhpRendererStrategyFactory.php rename to src/Container/ViewPhpRendererStrategyFactory.php index 6b83c7254..2dfe9909f 100644 --- a/src/Service/ViewPhpRendererStrategyFactory.php +++ b/src/Container/ViewPhpRendererStrategyFactory.php @@ -5,7 +5,7 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\ServiceManager\Factory\FactoryInterface; diff --git a/src/Service/ViewPrefixPathStackResolverFactory.php b/src/Container/ViewPrefixPathStackResolverFactory.php similarity index 97% rename from src/Service/ViewPrefixPathStackResolverFactory.php rename to src/Container/ViewPrefixPathStackResolverFactory.php index 08e9f49e1..11a29b3e2 100644 --- a/src/Service/ViewPrefixPathStackResolverFactory.php +++ b/src/Container/ViewPrefixPathStackResolverFactory.php @@ -5,7 +5,7 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\ServiceManager\Factory\FactoryInterface; diff --git a/src/Service/ViewResolverFactory.php b/src/Container/ViewResolverFactory.php similarity index 98% rename from src/Service/ViewResolverFactory.php rename to src/Container/ViewResolverFactory.php index ae743b8d2..42740ef0d 100644 --- a/src/Service/ViewResolverFactory.php +++ b/src/Container/ViewResolverFactory.php @@ -5,7 +5,7 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\ServiceManager\Factory\FactoryInterface; diff --git a/src/Service/ViewTemplateMapResolverFactory.php b/src/Container/ViewTemplateMapResolverFactory.php similarity index 97% rename from src/Service/ViewTemplateMapResolverFactory.php rename to src/Container/ViewTemplateMapResolverFactory.php index 18146d50f..a3727724e 100644 --- a/src/Service/ViewTemplateMapResolverFactory.php +++ b/src/Container/ViewTemplateMapResolverFactory.php @@ -5,7 +5,7 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\ServiceManager\Factory\FactoryInterface; diff --git a/src/Service/ViewTemplatePathStackFactory.php b/src/Container/ViewTemplatePathStackFactory.php similarity index 98% rename from src/Service/ViewTemplatePathStackFactory.php rename to src/Container/ViewTemplatePathStackFactory.php index cf7f01af0..e1a6b59b3 100644 --- a/src/Service/ViewTemplatePathStackFactory.php +++ b/src/Container/ViewTemplatePathStackFactory.php @@ -5,7 +5,7 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace Zend\Mvc\Service; +namespace Zend\Mvc\Container; use Interop\Container\ContainerInterface; use Zend\ServiceManager\Factory\FactoryInterface; diff --git a/test/Application/BadControllerTrait.php b/test/Application/BadControllerTrait.php index 5d2f57d75..b45c050d4 100644 --- a/test/Application/BadControllerTrait.php +++ b/test/Application/BadControllerTrait.php @@ -12,8 +12,8 @@ use Zend\Http\PhpEnvironment\Response; use Zend\Mvc\Application; use Zend\Mvc\Controller\ControllerManager; -use Zend\Mvc\Service\ServiceManagerConfig; -use Zend\Mvc\Service\ServiceListenerFactory; +use Zend\Mvc\Container\ServiceManagerConfig; +use Zend\Mvc\Container\ServiceListenerFactory; use Zend\Router; use Zend\ServiceManager\ServiceManager; use Zend\Stdlib\ArrayUtils; diff --git a/test/Application/InvalidControllerTypeTrait.php b/test/Application/InvalidControllerTypeTrait.php index 5478a638a..a50b496f8 100644 --- a/test/Application/InvalidControllerTypeTrait.php +++ b/test/Application/InvalidControllerTypeTrait.php @@ -13,8 +13,8 @@ use Zend\Http\PhpEnvironment\Response; use Zend\Mvc\Application; use Zend\Mvc\Controller\ControllerManager; -use Zend\Mvc\Service\ServiceManagerConfig; -use Zend\Mvc\Service\ServiceListenerFactory; +use Zend\Mvc\Container\ServiceManagerConfig; +use Zend\Mvc\Container\ServiceListenerFactory; use Zend\Router; use Zend\ServiceManager\ServiceManager; use Zend\Stdlib\ArrayUtils; diff --git a/test/Application/MissingControllerTrait.php b/test/Application/MissingControllerTrait.php index 8921b78ea..141168898 100644 --- a/test/Application/MissingControllerTrait.php +++ b/test/Application/MissingControllerTrait.php @@ -11,8 +11,8 @@ use Zend\Http\PhpEnvironment\Request; use Zend\Http\PhpEnvironment\Response; use Zend\Mvc\Application; -use Zend\Mvc\Service\ServiceManagerConfig; -use Zend\Mvc\Service\ServiceListenerFactory; +use Zend\Mvc\Container\ServiceManagerConfig; +use Zend\Mvc\Container\ServiceListenerFactory; use Zend\Router; use Zend\ServiceManager\ServiceManager; use Zend\Stdlib\ArrayUtils; diff --git a/test/Application/PathControllerTrait.php b/test/Application/PathControllerTrait.php index f511e8684..075ee1997 100644 --- a/test/Application/PathControllerTrait.php +++ b/test/Application/PathControllerTrait.php @@ -12,8 +12,8 @@ use Zend\Http\PhpEnvironment\Response; use Zend\Mvc\Application; use Zend\Mvc\Controller\ControllerManager; -use Zend\Mvc\Service\ServiceManagerConfig; -use Zend\Mvc\Service\ServiceListenerFactory; +use Zend\Mvc\Container\ServiceManagerConfig; +use Zend\Mvc\Container\ServiceListenerFactory; use Zend\Router; use Zend\ServiceManager\ServiceManager; use Zend\Stdlib\ArrayUtils; diff --git a/test/Application/TestAsset/modules/Application/config/module.config.php b/test/Application/TestAsset/modules/Application/config/module.config.php index db068ccca..669e51af7 100644 --- a/test/Application/TestAsset/modules/Application/config/module.config.php +++ b/test/Application/TestAsset/modules/Application/config/module.config.php @@ -9,7 +9,7 @@ use Zend\Http\PhpEnvironment\Request as HttpRequest; use Zend\Http\PhpEnvironment\Response as HttpResponse; -use Zend\Mvc\Service\HttpViewManagerFactory; +use Zend\Mvc\Container\HttpViewManagerFactory; use Zend\Router\Http\HttpRouterFactory; return [ diff --git a/test/ApplicationTest.php b/test/ApplicationTest.php index 35da58855..37682a561 100644 --- a/test/ApplicationTest.php +++ b/test/ApplicationTest.php @@ -21,8 +21,8 @@ use Zend\Mvc\Application; use Zend\Mvc\Controller\ControllerManager; use Zend\Mvc\MvcEvent; -use Zend\Mvc\Service\ServiceManagerConfig; -use Zend\Mvc\Service\ServiceListenerFactory; +use Zend\Mvc\Container\ServiceManagerConfig; +use Zend\Mvc\Container\ServiceListenerFactory; use Zend\Router; use Zend\ServiceManager\ServiceManager; use Zend\Stdlib\ArrayUtils; diff --git a/test/Service/ControllerManagerFactoryTest.php b/test/Container/ControllerManagerFactoryTest.php similarity index 94% rename from test/Service/ControllerManagerFactoryTest.php rename to test/Container/ControllerManagerFactoryTest.php index 39aa57ddc..01dbc5723 100644 --- a/test/Service/ControllerManagerFactoryTest.php +++ b/test/Container/ControllerManagerFactoryTest.php @@ -5,19 +5,20 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace ZendTest\Mvc\Service; +namespace ZendTest\Mvc\Container; use PHPUnit\Framework\TestCase; use Zend\EventManager\SharedEventManager; -use Zend\Mvc\Service\ControllerManagerFactory; -use Zend\Mvc\Service\ControllerPluginManagerFactory; -use Zend\Mvc\Service\EventManagerFactory; +use Zend\Mvc\Container\ControllerManagerFactory; +use Zend\Mvc\Container\ControllerPluginManagerFactory; +use Zend\Mvc\Container\EventManagerFactory; use Zend\ServiceManager\Config; use Zend\ServiceManager\Exception; use Zend\ServiceManager\Factory\InvokableFactory; use Zend\ServiceManager\ServiceManager; use ZendTest\Mvc\Controller\Plugin\TestAsset\SamplePlugin; use ZendTest\Mvc\Controller\TestAsset\SampleController; +use ZendTest\Mvc\Service\TestAsset; use ZendTest\Mvc\Service\TestAsset\InvalidDispatchableClass; class ControllerManagerFactoryTest extends TestCase diff --git a/test/Service/HttpMethodListenerFactoryTest.php b/test/Container/HttpMethodListenerFactoryTest.php similarity index 92% rename from test/Service/HttpMethodListenerFactoryTest.php rename to test/Container/HttpMethodListenerFactoryTest.php index 230ad0ae4..934a7d6d9 100644 --- a/test/Service/HttpMethodListenerFactoryTest.php +++ b/test/Container/HttpMethodListenerFactoryTest.php @@ -5,16 +5,16 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace ZendTest\Mvc\Service; +namespace ZendTest\Mvc\Container; use Interop\Container\ContainerInterface; use PHPUnit\Framework\TestCase; use PHPUnit_Framework_MockObject_MockObject as MockObject; -use Zend\Mvc\Service\HttpMethodListenerFactory; +use Zend\Mvc\Container\HttpMethodListenerFactory; use Zend\ServiceManager\ServiceLocatorInterface; /** - * @covers Zend\Mvc\Service\HttpMethodListenerFactory + * @covers \Zend\Mvc\Container\HttpMethodListenerFactory */ class HttpMethodListenerFactoryTest extends TestCase { diff --git a/test/Service/InjectTemplateListenerFactoryTest.php b/test/Container/InjectTemplateListenerFactoryTest.php similarity index 91% rename from test/Service/InjectTemplateListenerFactoryTest.php rename to test/Container/InjectTemplateListenerFactoryTest.php index 2fb0b4e0d..99f515743 100644 --- a/test/Service/InjectTemplateListenerFactoryTest.php +++ b/test/Container/InjectTemplateListenerFactoryTest.php @@ -5,19 +5,19 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace ZendTest\Mvc\Service; +namespace ZendTest\Mvc\Container; use ArrayObject; use Interop\Container\ContainerInterface; use PHPUnit\Framework\TestCase; -use Zend\Mvc\Service\InjectTemplateListenerFactory; +use Zend\Mvc\Container\InjectTemplateListenerFactory; use Zend\Mvc\View\Http\InjectTemplateListener; use Zend\ServiceManager\ServiceLocatorInterface; /** - * Tests for {@see \Zend\Mvc\Service\InjectTemplateListenerFactory} + * Tests for {@see \Zend\Mvc\Container\InjectTemplateListenerFactory} * - * @covers \Zend\Mvc\Service\InjectTemplateListenerFactory + * @covers \Zend\Mvc\Container\InjectTemplateListenerFactory */ class InjectTemplateListenerFactoryTest extends TestCase { diff --git a/test/Service/RequestFactoryTest.php b/test/Container/RequestFactoryTest.php similarity index 90% rename from test/Service/RequestFactoryTest.php rename to test/Container/RequestFactoryTest.php index bf3382e6c..b7f14458b 100644 --- a/test/Service/RequestFactoryTest.php +++ b/test/Container/RequestFactoryTest.php @@ -5,12 +5,12 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace ZendTest\Mvc\Service; +namespace ZendTest\Mvc\Container; use Interop\Container\ContainerInterface; use PHPUnit\Framework\TestCase; use Zend\Http\Request as HttpRequest; -use Zend\Mvc\Service\RequestFactory; +use Zend\Mvc\Container\RequestFactory; class RequestFactoryTest extends TestCase { diff --git a/test/Service/ResponseFactoryTest.php b/test/Container/ResponseFactoryTest.php similarity index 90% rename from test/Service/ResponseFactoryTest.php rename to test/Container/ResponseFactoryTest.php index 47c6a6142..7ac7b9cf3 100644 --- a/test/Service/ResponseFactoryTest.php +++ b/test/Container/ResponseFactoryTest.php @@ -5,12 +5,12 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace ZendTest\Mvc\Service; +namespace ZendTest\Mvc\Container; use Interop\Container\ContainerInterface; use PHPUnit\Framework\TestCase; use Zend\Http\Response as HttpResponse; -use Zend\Mvc\Service\ResponseFactory; +use Zend\Mvc\Container\ResponseFactory; class ResponseFactoryTest extends TestCase { diff --git a/test/Service/SendResponseListenerFactoryTest.php b/test/Container/SendResponseListenerFactoryTest.php similarity index 96% rename from test/Service/SendResponseListenerFactoryTest.php rename to test/Container/SendResponseListenerFactoryTest.php index e9adc2f22..b5eb7b18f 100644 --- a/test/Service/SendResponseListenerFactoryTest.php +++ b/test/Container/SendResponseListenerFactoryTest.php @@ -5,19 +5,19 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace ZendTest\Mvc\Service; +namespace ZendTest\Mvc\Container; use Interop\Container\ContainerInterface; use PHPUnit\Framework\TestCase; use Prophecy\Argument; use Zend\EventManager\EventManagerInterface; use Zend\EventManager\SharedEventManagerInterface; +use Zend\Mvc\Container\SendResponseListenerFactory; use Zend\Mvc\ResponseSender\HttpResponseSender; use Zend\Mvc\ResponseSender\PhpEnvironmentResponseSender; use Zend\Mvc\ResponseSender\SendResponseEvent; use Zend\Mvc\ResponseSender\SimpleStreamResponseSender; use Zend\Mvc\SendResponseListener; -use Zend\Mvc\Service\SendResponseListenerFactory; class SendResponseListenerFactoryTest extends TestCase { diff --git a/test/Service/ServiceListenerFactoryTest.php b/test/Container/ServiceListenerFactoryTest.php similarity index 98% rename from test/Service/ServiceListenerFactoryTest.php rename to test/Container/ServiceListenerFactoryTest.php index 0d71cb93a..c6527734a 100644 --- a/test/Service/ServiceListenerFactoryTest.php +++ b/test/Container/ServiceListenerFactoryTest.php @@ -5,12 +5,10 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace ZendTest\Mvc\Service; +namespace ZendTest\Mvc\Container; use PHPUnit\Framework\TestCase; -use ReflectionClass; -use ReflectionProperty; -use Zend\Mvc\Service\ServiceListenerFactory; +use Zend\Mvc\Container\ServiceListenerFactory; use Zend\ServiceManager\ServiceManager; class ServiceListenerFactoryTest extends TestCase diff --git a/test/Service/ServiceManagerConfigTest.php b/test/Container/ServiceManagerConfigTest.php similarity index 96% rename from test/Service/ServiceManagerConfigTest.php rename to test/Container/ServiceManagerConfigTest.php index c767403e8..d5739267d 100644 --- a/test/Service/ServiceManagerConfigTest.php +++ b/test/Container/ServiceManagerConfigTest.php @@ -5,22 +5,20 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace ZendTest\Mvc\Service; +namespace ZendTest\Mvc\Container; use PHPUnit\Framework\TestCase; -use ReflectionClass; use stdClass; use Zend\EventManager\EventManager; use Zend\EventManager\EventManagerAwareInterface; use Zend\EventManager\SharedEventManagerInterface; -use Zend\Mvc\Controller\PluginManager; -use Zend\Mvc\Service\ServiceManagerConfig; +use Zend\Mvc\Container\ServiceManagerConfig; use Zend\ServiceManager\Factory\InvokableFactory; use Zend\ServiceManager\ServiceManager; use ZendTest\Mvc\Service\TestAsset\EventManagerAwareObject; /** - * @covers \Zend\Mvc\Service\ServiceManagerConfig + * @covers \Zend\Mvc\Container\ServiceManagerConfig */ class ServiceManagerConfigTest extends TestCase { diff --git a/test/Service/ViewFeedStrategyFactoryTest.php b/test/Container/ViewFeedStrategyFactoryTest.php similarity index 92% rename from test/Service/ViewFeedStrategyFactoryTest.php rename to test/Container/ViewFeedStrategyFactoryTest.php index d6f24b7e9..e15f4f707 100644 --- a/test/Service/ViewFeedStrategyFactoryTest.php +++ b/test/Container/ViewFeedStrategyFactoryTest.php @@ -5,11 +5,11 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace ZendTest\Mvc\Service; +namespace ZendTest\Mvc\Container; use Interop\Container\ContainerInterface; use PHPUnit\Framework\TestCase; -use Zend\Mvc\Service\ViewFeedStrategyFactory; +use Zend\Mvc\Container\ViewFeedStrategyFactory; use Zend\View\Renderer\FeedRenderer; use Zend\View\Strategy\FeedStrategy; diff --git a/test/Service/ViewHelperManagerFactoryTest.php b/test/Container/ViewHelperManagerFactoryTest.php similarity index 98% rename from test/Service/ViewHelperManagerFactoryTest.php rename to test/Container/ViewHelperManagerFactoryTest.php index fc9b3a15b..1030ed888 100644 --- a/test/Service/ViewHelperManagerFactoryTest.php +++ b/test/Container/ViewHelperManagerFactoryTest.php @@ -5,13 +5,13 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace ZendTest\Mvc\Service; +namespace ZendTest\Mvc\Container; use PHPUnit\Framework\TestCase; use Zend\Http\PhpEnvironment\Request; use Zend\Mvc\Application; +use Zend\Mvc\Container\ViewHelperManagerFactory; use Zend\Mvc\MvcEvent; -use Zend\Mvc\Service\ViewHelperManagerFactory; use Zend\Router\RouteMatch; use Zend\Router\RouteStackInterface; use Zend\ServiceManager\ServiceManager; diff --git a/test/Service/ViewJsonStrategyFactoryTest.php b/test/Container/ViewJsonStrategyFactoryTest.php similarity index 92% rename from test/Service/ViewJsonStrategyFactoryTest.php rename to test/Container/ViewJsonStrategyFactoryTest.php index 0768537c9..202250700 100644 --- a/test/Service/ViewJsonStrategyFactoryTest.php +++ b/test/Container/ViewJsonStrategyFactoryTest.php @@ -5,11 +5,11 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace ZendTest\Mvc\Service; +namespace ZendTest\Mvc\Container; use Interop\Container\ContainerInterface; use PHPUnit\Framework\TestCase; -use Zend\Mvc\Service\ViewJsonStrategyFactory; +use Zend\Mvc\Container\ViewJsonStrategyFactory; use Zend\View\Renderer\JsonRenderer; use Zend\View\Strategy\JsonStrategy; diff --git a/test/Service/ViewManagerFactoryTest.php b/test/Container/ViewManagerFactoryTest.php similarity index 93% rename from test/Service/ViewManagerFactoryTest.php rename to test/Container/ViewManagerFactoryTest.php index 2d28a13d0..a77d9a49d 100644 --- a/test/Service/ViewManagerFactoryTest.php +++ b/test/Container/ViewManagerFactoryTest.php @@ -5,11 +5,11 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace ZendTest\Mvc\Service; +namespace ZendTest\Mvc\Container; use Interop\Container\ContainerInterface; use PHPUnit\Framework\TestCase; -use Zend\Mvc\Service\ViewManagerFactory; +use Zend\Mvc\Container\ViewManagerFactory; use Zend\Mvc\View\Http\ViewManager as HttpViewManager; class ViewManagerFactoryTest extends TestCase diff --git a/test/Service/ViewPrefixPathStackResolverFactoryTest.php b/test/Container/ViewPrefixPathStackResolverFactoryTest.php similarity index 92% rename from test/Service/ViewPrefixPathStackResolverFactoryTest.php rename to test/Container/ViewPrefixPathStackResolverFactoryTest.php index e0dedba2c..8ecf83207 100644 --- a/test/Service/ViewPrefixPathStackResolverFactoryTest.php +++ b/test/Container/ViewPrefixPathStackResolverFactoryTest.php @@ -5,11 +5,11 @@ * @license https://github.com/zendframework/zend-mvc/blob/master/LICENSE.md New BSD License */ -namespace ZendTest\Mvc\Service; +namespace ZendTest\Mvc\Container; use Interop\Container\ContainerInterface; use PHPUnit\Framework\TestCase; -use Zend\Mvc\Service\ViewPrefixPathStackResolverFactory; +use Zend\Mvc\Container\ViewPrefixPathStackResolverFactory; use Zend\ServiceManager\ServiceLocatorInterface; use Zend\View\Resolver\PrefixPathStackResolver; From d0d11322c8d7a05c491b647e9e514a4dd1abbbb5 Mon Sep 17 00:00:00 2001 From: Aleksei Khudiakov Date: Sat, 13 Jan 2018 06:31:39 +1000 Subject: [PATCH 2/2] Add deprecated factories in Service namespace for BC --- src/Service/ApplicationFactory.php | 17 +++++++++++++++++ src/Service/ConfigFactory.php | 17 +++++++++++++++++ src/Service/ControllerManagerFactory.php | 17 +++++++++++++++++ src/Service/ControllerPluginManagerFactory.php | 17 +++++++++++++++++ src/Service/DispatchListenerFactory.php | 17 +++++++++++++++++ src/Service/EventManagerFactory.php | 17 +++++++++++++++++ .../HttpDefaultRenderingStrategyFactory.php | 17 +++++++++++++++++ src/Service/HttpExceptionStrategyFactory.php | 17 +++++++++++++++++ src/Service/HttpMethodListenerFactory.php | 17 +++++++++++++++++ .../HttpRouteNotFoundStrategyFactory.php | 17 +++++++++++++++++ src/Service/HttpViewManagerConfigTrait.php | 18 ++++++++++++++++++ src/Service/HttpViewManagerFactory.php | 17 +++++++++++++++++ src/Service/InjectTemplateListenerFactory.php | 17 +++++++++++++++++ src/Service/ModuleManagerFactory.php | 17 +++++++++++++++++ src/Service/PaginatorPluginManagerFactory.php | 17 +++++++++++++++++ src/Service/RequestFactory.php | 17 +++++++++++++++++ src/Service/ResponseFactory.php | 17 +++++++++++++++++ src/Service/SendResponseListenerFactory.php | 17 +++++++++++++++++ src/Service/ServiceListenerFactory.php | 17 +++++++++++++++++ src/Service/ServiceManagerConfig.php | 17 +++++++++++++++++ src/Service/ViewFactory.php | 17 +++++++++++++++++ src/Service/ViewFeedStrategyFactory.php | 17 +++++++++++++++++ src/Service/ViewHelperManagerFactory.php | 17 +++++++++++++++++ src/Service/ViewJsonStrategyFactory.php | 17 +++++++++++++++++ src/Service/ViewManagerFactory.php | 17 +++++++++++++++++ src/Service/ViewPhpRendererFactory.php | 17 +++++++++++++++++ src/Service/ViewPhpRendererStrategyFactory.php | 17 +++++++++++++++++ .../ViewPrefixPathStackResolverFactory.php | 17 +++++++++++++++++ src/Service/ViewResolverFactory.php | 17 +++++++++++++++++ src/Service/ViewTemplateMapResolverFactory.php | 17 +++++++++++++++++ src/Service/ViewTemplatePathStackFactory.php | 17 +++++++++++++++++ 31 files changed, 528 insertions(+) create mode 100644 src/Service/ApplicationFactory.php create mode 100644 src/Service/ConfigFactory.php create mode 100644 src/Service/ControllerManagerFactory.php create mode 100644 src/Service/ControllerPluginManagerFactory.php create mode 100644 src/Service/DispatchListenerFactory.php create mode 100644 src/Service/EventManagerFactory.php create mode 100644 src/Service/HttpDefaultRenderingStrategyFactory.php create mode 100644 src/Service/HttpExceptionStrategyFactory.php create mode 100644 src/Service/HttpMethodListenerFactory.php create mode 100644 src/Service/HttpRouteNotFoundStrategyFactory.php create mode 100644 src/Service/HttpViewManagerConfigTrait.php create mode 100644 src/Service/HttpViewManagerFactory.php create mode 100644 src/Service/InjectTemplateListenerFactory.php create mode 100644 src/Service/ModuleManagerFactory.php create mode 100644 src/Service/PaginatorPluginManagerFactory.php create mode 100644 src/Service/RequestFactory.php create mode 100644 src/Service/ResponseFactory.php create mode 100644 src/Service/SendResponseListenerFactory.php create mode 100644 src/Service/ServiceListenerFactory.php create mode 100644 src/Service/ServiceManagerConfig.php create mode 100644 src/Service/ViewFactory.php create mode 100644 src/Service/ViewFeedStrategyFactory.php create mode 100644 src/Service/ViewHelperManagerFactory.php create mode 100644 src/Service/ViewJsonStrategyFactory.php create mode 100644 src/Service/ViewManagerFactory.php create mode 100644 src/Service/ViewPhpRendererFactory.php create mode 100644 src/Service/ViewPhpRendererStrategyFactory.php create mode 100644 src/Service/ViewPrefixPathStackResolverFactory.php create mode 100644 src/Service/ViewResolverFactory.php create mode 100644 src/Service/ViewTemplateMapResolverFactory.php create mode 100644 src/Service/ViewTemplatePathStackFactory.php diff --git a/src/Service/ApplicationFactory.php b/src/Service/ApplicationFactory.php new file mode 100644 index 000000000..ec1188b92 --- /dev/null +++ b/src/Service/ApplicationFactory.php @@ -0,0 +1,17 @@ +