Added the container object to the Middleware

This commit is contained in:
Dave M. 2021-01-06 19:30:49 +00:00
parent ffe5ddb783
commit 1eb891a283
1 changed files with 5 additions and 1 deletions

View File

@ -18,11 +18,14 @@ class CronardMiddleware implements MiddlewareInterface
public array $variables = [];
public $response;
public $container;
public function __construct(string $cronKey = "", $responseInterface, $variables = []) {
public function __construct(ContainerInterface $container, string $cronKey = "", $responseInterface, $variables = []) {
$this->cronKey = $cronKey;
$this->response = $responseInterface;
$this->variables = $variables;
$this->container = $container;
}
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
@ -33,6 +36,7 @@ class CronardMiddleware implements MiddlewareInterface
$this->launch([
$request,
$response,
$this->container,
]);
return $response;