From 2df09d798895e383724ad94912b0654a6d70c501 Mon Sep 17 00:00:00 2001 From: rotimi Date: Sat, 25 May 2024 17:25:14 -0600 Subject: [PATCH] Added ContainerInterface type-hint to anonymous functions in the dependencies file --- config/dependencies-dist.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/config/dependencies-dist.php b/config/dependencies-dist.php index 87a8986..25550d6 100644 --- a/config/dependencies-dist.php +++ b/config/dependencies-dist.php @@ -1,6 +1,7 @@ factory(function ($c) { +$container[ContainerKeys::LAYOUT_RENDERER] = $container->factory(function (ContainerInterface $c) { // See https://github.com/rotexsoft/file-renderer // Return a new instance on each access to @@ -80,7 +81,7 @@ }); // Object for rendering view files -$container[ContainerKeys::VIEW_RENDERER] = $container->factory(function ($c) { +$container[ContainerKeys::VIEW_RENDERER] = $container->factory(function (ContainerInterface $c) { // See https://github.com/rotexsoft/file-renderer // Return a new instance on each access to @@ -101,7 +102,7 @@ // // \SlimMvcTools\Controllers\BaseController->actionLogin will work out of // the box with any properly configured \Vespula\Auth\Adapter\* instance. -$container[ContainerKeys::VESPULA_AUTH] = function ($c) { +$container[ContainerKeys::VESPULA_AUTH] = function (ContainerInterface $c) { // See https://packagist.org/packages/vespula/auth $pdo = new \PDO( @@ -146,14 +147,14 @@ //////////////////////////////////////////////////////////////////////////// // New PSR 7 Request Object -$container[ContainerKeys::NEW_REQUEST_OBJECT] = $container->factory(function ($c) { +$container[ContainerKeys::NEW_REQUEST_OBJECT] = $container->factory(function (ContainerInterface $c) { $serverRequestCreator = \Slim\Factory\ServerRequestCreatorFactory::create(); return $serverRequestCreator->createServerRequestFromGlobals(); }); // New PSR 7 Response Object -$container[ContainerKeys::NEW_RESPONSE_OBJECT] = $container->factory(function ($c) { +$container[ContainerKeys::NEW_RESPONSE_OBJECT] = $container->factory(function (ContainerInterface $c) { $responseFactory = \Slim\Factory\AppFactory::determineResponseFactory(); return $responseFactory->createResponse();