diff --git a/src/Application.php b/src/Application.php index 9fc812a6..5d34785b 100644 --- a/src/Application.php +++ b/src/Application.php @@ -94,9 +94,9 @@ class Application implements */ public function __construct( protected ServiceManager $serviceManager, - EventManagerInterface $events = null, - RequestInterface $request = null, - ResponseInterface $response = null + ?EventManagerInterface $events = null, + ?RequestInterface $request = null, + ?ResponseInterface $response = null ) { $this->setEventManager($events ?: $serviceManager->get('EventManager')); $this->request = $request ?: $serviceManager->get('Request'); diff --git a/src/MiddlewareListener.php b/src/MiddlewareListener.php index cfa4408e..77368112 100644 --- a/src/MiddlewareListener.php +++ b/src/MiddlewareListener.php @@ -165,7 +165,7 @@ protected function marshalInvalidMiddleware( $middlewareName, MvcEvent $event, Application $application, - Exception $exception = null + ?Exception $exception = null ) { $event->setName(MvcEvent::EVENT_DISPATCH_ERROR); $event->setError($type); diff --git a/src/Service/AbstractPluginManagerFactory.php b/src/Service/AbstractPluginManagerFactory.php index 60182fa0..1c2ed0b0 100644 --- a/src/Service/AbstractPluginManagerFactory.php +++ b/src/Service/AbstractPluginManagerFactory.php @@ -21,7 +21,7 @@ abstract class AbstractPluginManagerFactory implements FactoryInterface * @param null|array $options * @return AbstractPluginManager */ - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { $options = $options ?: []; $pluginManagerClass = static::PLUGIN_MANAGER_CLASS; diff --git a/src/Service/ApplicationFactory.php b/src/Service/ApplicationFactory.php index 3436f225..25d4cd5c 100644 --- a/src/Service/ApplicationFactory.php +++ b/src/Service/ApplicationFactory.php @@ -19,7 +19,7 @@ class ApplicationFactory implements FactoryInterface * @param null|array $options * @return Application */ - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { return new Application( $container, diff --git a/src/Service/ControllerManagerFactory.php b/src/Service/ControllerManagerFactory.php index 14ce12a9..c538d92d 100644 --- a/src/Service/ControllerManagerFactory.php +++ b/src/Service/ControllerManagerFactory.php @@ -23,7 +23,7 @@ class ControllerManagerFactory implements FactoryInterface * @param null|array $options * @return ControllerManager */ - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { if ($options) { return new ControllerManager($container, $options); diff --git a/src/Service/DispatchListenerFactory.php b/src/Service/DispatchListenerFactory.php index 62b0cb37..c7f89048 100644 --- a/src/Service/DispatchListenerFactory.php +++ b/src/Service/DispatchListenerFactory.php @@ -16,7 +16,7 @@ class DispatchListenerFactory implements FactoryInterface * @param null|array $options * @return DispatchListener */ - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { return new DispatchListener($container->get('ControllerManager')); } diff --git a/src/Service/EventManagerFactory.php b/src/Service/EventManagerFactory.php index d5818e0c..213e2c05 100644 --- a/src/Service/EventManagerFactory.php +++ b/src/Service/EventManagerFactory.php @@ -19,7 +19,7 @@ class EventManagerFactory implements FactoryInterface * @param null|array $options * @return EventManager */ - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { $shared = $container->has('SharedEventManager') ? $container->get('SharedEventManager') : null; diff --git a/src/Service/HttpDefaultRenderingStrategyFactory.php b/src/Service/HttpDefaultRenderingStrategyFactory.php index ba310e5d..ac2acbea 100644 --- a/src/Service/HttpDefaultRenderingStrategyFactory.php +++ b/src/Service/HttpDefaultRenderingStrategyFactory.php @@ -17,7 +17,7 @@ class HttpDefaultRenderingStrategyFactory implements FactoryInterface * @param null|array $options * @return DefaultRenderingStrategy */ - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { $strategy = new DefaultRenderingStrategy($container->get(View::class)); $config = $this->getConfig($container); diff --git a/src/Service/HttpExceptionStrategyFactory.php b/src/Service/HttpExceptionStrategyFactory.php index b4c55dea..4ff562b9 100644 --- a/src/Service/HttpExceptionStrategyFactory.php +++ b/src/Service/HttpExceptionStrategyFactory.php @@ -16,7 +16,7 @@ class HttpExceptionStrategyFactory implements FactoryInterface * @param null|array $options * @return ExceptionStrategy */ - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { $strategy = new ExceptionStrategy(); $config = $this->getConfig($container); diff --git a/src/Service/HttpMethodListenerFactory.php b/src/Service/HttpMethodListenerFactory.php index 6152ebc3..bd3f7903 100644 --- a/src/Service/HttpMethodListenerFactory.php +++ b/src/Service/HttpMethodListenerFactory.php @@ -12,7 +12,7 @@ class HttpMethodListenerFactory implements FactoryInterface * {@inheritdoc} * @return HttpMethodListener */ - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { $config = $container->get('config'); diff --git a/src/Service/HttpRouteNotFoundStrategyFactory.php b/src/Service/HttpRouteNotFoundStrategyFactory.php index 1e33511c..71fc1ca3 100644 --- a/src/Service/HttpRouteNotFoundStrategyFactory.php +++ b/src/Service/HttpRouteNotFoundStrategyFactory.php @@ -16,7 +16,7 @@ class HttpRouteNotFoundStrategyFactory implements FactoryInterface * @param null|array $options * @return RouteNotFoundStrategy */ - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { $strategy = new RouteNotFoundStrategy(); $config = $this->getConfig($container); diff --git a/src/Service/HttpViewManagerFactory.php b/src/Service/HttpViewManagerFactory.php index cda573d0..eb7cf67e 100644 --- a/src/Service/HttpViewManagerFactory.php +++ b/src/Service/HttpViewManagerFactory.php @@ -16,7 +16,7 @@ class HttpViewManagerFactory implements FactoryInterface * @param null|array $options * @return HttpViewManager */ - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { return new HttpViewManager(); } diff --git a/src/Service/InjectTemplateListenerFactory.php b/src/Service/InjectTemplateListenerFactory.php index b7d27d78..9b29844a 100644 --- a/src/Service/InjectTemplateListenerFactory.php +++ b/src/Service/InjectTemplateListenerFactory.php @@ -15,7 +15,7 @@ class InjectTemplateListenerFactory implements FactoryInterface * * @return InjectTemplateListener */ - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { $listener = new InjectTemplateListener(); $config = $container->get('config'); diff --git a/src/Service/ModuleManagerFactory.php b/src/Service/ModuleManagerFactory.php index 1fbde489..762b3284 100644 --- a/src/Service/ModuleManagerFactory.php +++ b/src/Service/ModuleManagerFactory.php @@ -27,7 +27,7 @@ class ModuleManagerFactory implements FactoryInterface * @param null|array $options * @return ModuleManager */ - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { $configuration = $container->get('ApplicationConfig'); $listenerOptions = new ListenerOptions($configuration['module_listener_options']); diff --git a/src/Service/RequestFactory.php b/src/Service/RequestFactory.php index 77d2e0ee..1a46026b 100644 --- a/src/Service/RequestFactory.php +++ b/src/Service/RequestFactory.php @@ -16,7 +16,7 @@ class RequestFactory implements FactoryInterface * @param null|array $options * @return HttpRequest */ - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { return new HttpRequest(); } diff --git a/src/Service/ResponseFactory.php b/src/Service/ResponseFactory.php index bd870714..714fbac9 100644 --- a/src/Service/ResponseFactory.php +++ b/src/Service/ResponseFactory.php @@ -16,7 +16,7 @@ class ResponseFactory implements FactoryInterface * @param null|array $options * @return HttpResponse */ - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { return new HttpResponse(); } diff --git a/src/Service/ServiceListenerFactory.php b/src/Service/ServiceListenerFactory.php index bb95f09e..fb71041f 100644 --- a/src/Service/ServiceListenerFactory.php +++ b/src/Service/ServiceListenerFactory.php @@ -116,7 +116,7 @@ class ServiceListenerFactory implements FactoryInterface * @throws ServiceNotCreatedException for invalid ServiceListener service * @throws ServiceNotCreatedException For invalid configurations. */ - public function __invoke(ContainerInterface $container, $requestedName, array $options = null) + public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null) { $configuration = $container->get('ApplicationConfig'); diff --git a/src/Service/ViewFactory.php b/src/Service/ViewFactory.php index 934eacd1..aa0c25e3 100644 --- a/src/Service/ViewFactory.php +++ b/src/Service/ViewFactory.php @@ -15,7 +15,7 @@ class ViewFactory implements FactoryInterface * @param null|array $options * @return View */ - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { $view = new View(); $events = $container->get('EventManager'); diff --git a/src/Service/ViewHelperManagerFactory.php b/src/Service/ViewHelperManagerFactory.php index 17f5148c..83b4acf6 100644 --- a/src/Service/ViewHelperManagerFactory.php +++ b/src/Service/ViewHelperManagerFactory.php @@ -34,7 +34,7 @@ class ViewHelperManagerFactory extends AbstractPluginManagerFactory * @return HelperPluginManager * @throws ServiceNotCreatedException */ - public function __invoke(ContainerInterface $container, $requestedName, array $options = null) + public function __invoke(ContainerInterface $container, $requestedName, ?array $options = null) { $options = $options ?: []; $options['factories'] ??= []; diff --git a/src/Service/ViewManagerFactory.php b/src/Service/ViewManagerFactory.php index aed5ba67..6747cbb8 100644 --- a/src/Service/ViewManagerFactory.php +++ b/src/Service/ViewManagerFactory.php @@ -16,7 +16,7 @@ class ViewManagerFactory implements FactoryInterface * @param null|array $options * @return HttpViewManager */ - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { return $container->get('HttpViewManager'); } diff --git a/src/Service/ViewPhpRendererFactory.php b/src/Service/ViewPhpRendererFactory.php index 2472f07d..5686c124 100644 --- a/src/Service/ViewPhpRendererFactory.php +++ b/src/Service/ViewPhpRendererFactory.php @@ -14,7 +14,7 @@ class ViewPhpRendererFactory implements FactoryInterface * @param null|array $options * @return PhpRenderer */ - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { $renderer = new PhpRenderer(); $renderer->setHelperPluginManager($container->get('ViewHelperManager')); diff --git a/src/Service/ViewPhpRendererStrategyFactory.php b/src/Service/ViewPhpRendererStrategyFactory.php index da178645..ce83c472 100644 --- a/src/Service/ViewPhpRendererStrategyFactory.php +++ b/src/Service/ViewPhpRendererStrategyFactory.php @@ -15,7 +15,7 @@ class ViewPhpRendererStrategyFactory implements FactoryInterface * @param null|array $options * @return PhpRendererStrategy */ - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { return new PhpRendererStrategy($container->get(PhpRenderer::class)); } diff --git a/src/Service/ViewPrefixPathStackResolverFactory.php b/src/Service/ViewPrefixPathStackResolverFactory.php index 9d473adc..baa3c82d 100644 --- a/src/Service/ViewPrefixPathStackResolverFactory.php +++ b/src/Service/ViewPrefixPathStackResolverFactory.php @@ -19,7 +19,7 @@ class ViewPrefixPathStackResolverFactory implements FactoryInterface * @param null|array $options * @return PrefixPathStackResolver */ - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { $config = $container->get('config'); $prefixes = []; diff --git a/src/Service/ViewResolverFactory.php b/src/Service/ViewResolverFactory.php index 63bb8105..9f81c68e 100644 --- a/src/Service/ViewResolverFactory.php +++ b/src/Service/ViewResolverFactory.php @@ -20,7 +20,7 @@ class ViewResolverFactory implements FactoryInterface * @param null|array $options * @return ViewResolver\AggregateResolver */ - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { $resolver = new ViewResolver\AggregateResolver(); diff --git a/src/Service/ViewTemplateMapResolverFactory.php b/src/Service/ViewTemplateMapResolverFactory.php index aa69bb0d..28f357f1 100644 --- a/src/Service/ViewTemplateMapResolverFactory.php +++ b/src/Service/ViewTemplateMapResolverFactory.php @@ -19,7 +19,7 @@ class ViewTemplateMapResolverFactory implements FactoryInterface * @param null|array $options * @return ViewResolver\TemplateMapResolver */ - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { $config = $container->get('config'); $map = []; diff --git a/src/Service/ViewTemplatePathStackFactory.php b/src/Service/ViewTemplatePathStackFactory.php index fd364ba8..3c63e75a 100644 --- a/src/Service/ViewTemplatePathStackFactory.php +++ b/src/Service/ViewTemplatePathStackFactory.php @@ -20,7 +20,7 @@ class ViewTemplatePathStackFactory implements FactoryInterface * @param null|array $options * @return ViewResolver\TemplatePathStack */ - public function __invoke(ContainerInterface $container, $name, array $options = null) + public function __invoke(ContainerInterface $container, $name, ?array $options = null) { $config = $container->get('config');