Skip to content

Commit

Permalink
Merge pull request #172 from Atul-glo35265/php8.4_deprecation_fix
Browse files Browse the repository at this point in the history
Fix all implicitly nullable parameters for PHP 8.4 compatibility
  • Loading branch information
Xerkus authored Oct 18, 2024
2 parents ac1f308 + 8ce8a5e commit 8aaaee9
Show file tree
Hide file tree
Showing 26 changed files with 28 additions and 28 deletions.
6 changes: 3 additions & 3 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion src/MiddlewareListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Service/AbstractPluginManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Service/ApplicationFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/Service/ControllerManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Service/DispatchListenerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Service/EventManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/Service/HttpDefaultRenderingStrategyFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Service/HttpExceptionStrategyFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Service/HttpMethodListenerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
2 changes: 1 addition & 1 deletion src/Service/HttpRouteNotFoundStrategyFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Service/HttpViewManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Service/InjectTemplateListenerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion src/Service/ModuleManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down
2 changes: 1 addition & 1 deletion src/Service/RequestFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Service/ResponseFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Service/ServiceListenerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
2 changes: 1 addition & 1 deletion src/Service/ViewFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion src/Service/ViewHelperManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] ??= [];
Expand Down
2 changes: 1 addition & 1 deletion src/Service/ViewManagerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Service/ViewPhpRendererFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
2 changes: 1 addition & 1 deletion src/Service/ViewPhpRendererStrategyFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Service/ViewPrefixPathStackResolverFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down
2 changes: 1 addition & 1 deletion src/Service/ViewResolverFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion src/Service/ViewTemplateMapResolverFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down
2 changes: 1 addition & 1 deletion src/Service/ViewTemplatePathStackFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

0 comments on commit 8aaaee9

Please sign in to comment.