From ea2e52728bd89ff6830b0833a86ab25d70463af7 Mon Sep 17 00:00:00 2001 From: Dave Mc Nicoll Date: Wed, 15 Nov 2023 22:13:57 -0500 Subject: [PATCH] - Removed unused code --- meta/cronard.php | 2 +- src/CronardMiddleware.php | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/meta/cronard.php b/meta/cronard.php index 3fc0ff5..33fc66e 100644 --- a/meta/cronard.php +++ b/meta/cronard.php @@ -15,7 +15,7 @@ return [ CronardMiddleware::class => function($c) { $cronardMiddleware = new CronardMiddleware($c, getenv('CRON_KEY'), function() : ResponseInterface { return new HtmlResponse(sprintf("%s - cron task begin...", date('Y-m-d H:i:s'))); - }, [], $c->get(TaskFetcher::class)); + }, []); return $cronardMiddleware->fromFile(getenv("META_PATH")."/crontab.php")->fromAnnotations($c->get(TaskFetcher::class)); }, diff --git a/src/CronardMiddleware.php b/src/CronardMiddleware.php index 46b32e7..f3d8396 100644 --- a/src/CronardMiddleware.php +++ b/src/CronardMiddleware.php @@ -2,7 +2,6 @@ namespace Cronard; -use Notes\Cronard\TaskFetcher; use Psr\Http\Message\ResponseFactoryInterface, Psr\Container\ContainerInterface, Psr\Http\Message\ResponseInterface, @@ -22,10 +21,7 @@ class CronardMiddleware implements MiddlewareInterface public $container; - public ? TaskFetcher $taskFetcher; - public function __construct(ContainerInterface $container, string $cronKey = "", $responseInterface = null, $variables = []) { - $this->cronKey = $cronKey; $this->response = $responseInterface; $this->variables = $variables;