From 201fa88702e5e05150c6eecc7fbf1a0573a90a13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 14 Apr 2021 14:23:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- System/Crontab/Crontab.php | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/System/Crontab/Crontab.php b/System/Crontab/Crontab.php index b9727e27..aa3f6b1b 100644 --- a/System/Crontab/Crontab.php +++ b/System/Crontab/Crontab.php @@ -20,8 +20,6 @@ abstract class Crontab extends BaseObject const WAIT_END = 'crontab:wait:execute'; - private array|Closure $handler; - private string $name = ''; @@ -42,7 +40,6 @@ abstract class Crontab extends BaseObject private int $execute_number = 0; - private array|Closure|null $_max_execute_handler = null; private bool $_stop = false; @@ -66,13 +63,6 @@ abstract class Crontab extends BaseObject return $this; } - /** - * @return array|Closure - */ - public function getHandler(): array|Closure - { - return $this->handler; - } /** * @return string @@ -123,17 +113,6 @@ abstract class Crontab extends BaseObject } - /** - * @param array|Closure $handler - */ - public function setHandler(array|Closure $handler): void - { - if ($handler instanceof Closure) { - Closure::bind($handler, $this, $this); - } - $this->handler = $handler; - } - /** * @param string $name */ @@ -227,14 +206,6 @@ abstract class Crontab extends BaseObject } - /** - * @param Closure|array $closure - */ - public function setMaxExecute(Closure|array $closure) - { - $this->_max_execute_handler = $closure; - } - abstract public function process(): mixed; @@ -276,7 +247,7 @@ abstract class Crontab extends BaseObject */ private function isExit(): bool { - if ($this->_stop === true) { + if ($this->isStop()) { return true; } if (!$this->isLoop) {