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;