Skip to content

Commit 8aaaee9

Browse files
authored
Merge pull request #172 from Atul-glo35265/php8.4_deprecation_fix
Fix all implicitly nullable parameters for PHP 8.4 compatibility
2 parents ac1f308 + 8ce8a5e commit 8aaaee9

26 files changed

+28
-28
lines changed

src/Application.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ class Application implements
9494
*/
9595
public function __construct(
9696
protected ServiceManager $serviceManager,
97-
EventManagerInterface $events = null,
98-
RequestInterface $request = null,
99-
ResponseInterface $response = null
97+
?EventManagerInterface $events = null,
98+
?RequestInterface $request = null,
99+
?ResponseInterface $response = null
100100
) {
101101
$this->setEventManager($events ?: $serviceManager->get('EventManager'));
102102
$this->request = $request ?: $serviceManager->get('Request');

src/MiddlewareListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ protected function marshalInvalidMiddleware(
165165
$middlewareName,
166166
MvcEvent $event,
167167
Application $application,
168-
Exception $exception = null
168+
?Exception $exception = null
169169
) {
170170
$event->setName(MvcEvent::EVENT_DISPATCH_ERROR);
171171
$event->setError($type);

src/Service/AbstractPluginManagerFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ abstract class AbstractPluginManagerFactory implements FactoryInterface
2121
* @param null|array $options
2222
* @return AbstractPluginManager
2323
*/
24-
public function __invoke(ContainerInterface $container, $name, array $options = null)
24+
public function __invoke(ContainerInterface $container, $name, ?array $options = null)
2525
{
2626
$options = $options ?: [];
2727
$pluginManagerClass = static::PLUGIN_MANAGER_CLASS;

src/Service/ApplicationFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class ApplicationFactory implements FactoryInterface
1919
* @param null|array $options
2020
* @return Application
2121
*/
22-
public function __invoke(ContainerInterface $container, $name, array $options = null)
22+
public function __invoke(ContainerInterface $container, $name, ?array $options = null)
2323
{
2424
return new Application(
2525
$container,

src/Service/ControllerManagerFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ControllerManagerFactory implements FactoryInterface
2323
* @param null|array $options
2424
* @return ControllerManager
2525
*/
26-
public function __invoke(ContainerInterface $container, $name, array $options = null)
26+
public function __invoke(ContainerInterface $container, $name, ?array $options = null)
2727
{
2828
if ($options) {
2929
return new ControllerManager($container, $options);

src/Service/DispatchListenerFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class DispatchListenerFactory implements FactoryInterface
1616
* @param null|array $options
1717
* @return DispatchListener
1818
*/
19-
public function __invoke(ContainerInterface $container, $name, array $options = null)
19+
public function __invoke(ContainerInterface $container, $name, ?array $options = null)
2020
{
2121
return new DispatchListener($container->get('ControllerManager'));
2222
}

src/Service/EventManagerFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class EventManagerFactory implements FactoryInterface
1919
* @param null|array $options
2020
* @return EventManager
2121
*/
22-
public function __invoke(ContainerInterface $container, $name, array $options = null)
22+
public function __invoke(ContainerInterface $container, $name, ?array $options = null)
2323
{
2424
$shared = $container->has('SharedEventManager') ? $container->get('SharedEventManager') : null;
2525

src/Service/HttpDefaultRenderingStrategyFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class HttpDefaultRenderingStrategyFactory implements FactoryInterface
1717
* @param null|array $options
1818
* @return DefaultRenderingStrategy
1919
*/
20-
public function __invoke(ContainerInterface $container, $name, array $options = null)
20+
public function __invoke(ContainerInterface $container, $name, ?array $options = null)
2121
{
2222
$strategy = new DefaultRenderingStrategy($container->get(View::class));
2323
$config = $this->getConfig($container);

src/Service/HttpExceptionStrategyFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class HttpExceptionStrategyFactory implements FactoryInterface
1616
* @param null|array $options
1717
* @return ExceptionStrategy
1818
*/
19-
public function __invoke(ContainerInterface $container, $name, array $options = null)
19+
public function __invoke(ContainerInterface $container, $name, ?array $options = null)
2020
{
2121
$strategy = new ExceptionStrategy();
2222
$config = $this->getConfig($container);

src/Service/HttpMethodListenerFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class HttpMethodListenerFactory implements FactoryInterface
1212
* {@inheritdoc}
1313
* @return HttpMethodListener
1414
*/
15-
public function __invoke(ContainerInterface $container, $name, array $options = null)
15+
public function __invoke(ContainerInterface $container, $name, ?array $options = null)
1616
{
1717
$config = $container->get('config');
1818

0 commit comments

Comments
 (0)