- Removed unused code
This commit is contained in:
parent
ad8cb45cdc
commit
ea2e52728b
|
@ -15,7 +15,7 @@ return [
|
||||||
CronardMiddleware::class => function($c) {
|
CronardMiddleware::class => function($c) {
|
||||||
$cronardMiddleware = new CronardMiddleware($c, getenv('CRON_KEY'), function() : ResponseInterface {
|
$cronardMiddleware = new CronardMiddleware($c, getenv('CRON_KEY'), function() : ResponseInterface {
|
||||||
return new HtmlResponse(sprintf("%s - cron task begin...", date('Y-m-d H:i:s')));
|
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));
|
return $cronardMiddleware->fromFile(getenv("META_PATH")."/crontab.php")->fromAnnotations($c->get(TaskFetcher::class));
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
namespace Cronard;
|
namespace Cronard;
|
||||||
|
|
||||||
use Notes\Cronard\TaskFetcher;
|
|
||||||
use Psr\Http\Message\ResponseFactoryInterface,
|
use Psr\Http\Message\ResponseFactoryInterface,
|
||||||
Psr\Container\ContainerInterface,
|
Psr\Container\ContainerInterface,
|
||||||
Psr\Http\Message\ResponseInterface,
|
Psr\Http\Message\ResponseInterface,
|
||||||
|
@ -22,10 +21,7 @@ class CronardMiddleware implements MiddlewareInterface
|
||||||
|
|
||||||
public $container;
|
public $container;
|
||||||
|
|
||||||
public ? TaskFetcher $taskFetcher;
|
|
||||||
|
|
||||||
public function __construct(ContainerInterface $container, string $cronKey = "", $responseInterface = null, $variables = []) {
|
public function __construct(ContainerInterface $container, string $cronKey = "", $responseInterface = null, $variables = []) {
|
||||||
|
|
||||||
$this->cronKey = $cronKey;
|
$this->cronKey = $cronKey;
|
||||||
$this->response = $responseInterface;
|
$this->response = $responseInterface;
|
||||||
$this->variables = $variables;
|
$this->variables = $variables;
|
||||||
|
|
Loading…
Reference in New Issue