From e5d135cc8051fee7741ad3926e3e56f096ef9da4 Mon Sep 17 00:00:00 2001 From: Aaron Piotrowski Date: Wed, 24 Jul 2024 18:21:20 -0500 Subject: [PATCH] Rename property --- src/Interval.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Interval.php b/src/Interval.php index 9877598c..7618a31a 100644 --- a/src/Interval.php +++ b/src/Interval.php @@ -10,7 +10,7 @@ */ final class Interval { - private readonly string $watcher; + private readonly string $callbackId; /** * @param float $interval Invoke the function every $interval seconds. @@ -20,16 +20,16 @@ final class Interval */ public function __construct(float $interval, \Closure $closure, bool $reference = true) { - $this->watcher = EventLoop::repeat($interval, $closure); + $this->callbackId = EventLoop::repeat($interval, $closure); if (!$reference) { - EventLoop::unreference($this->watcher); + EventLoop::unreference($this->callbackId); } } public function __destruct() { - EventLoop::cancel($this->watcher); + EventLoop::cancel($this->callbackId); } /** @@ -37,7 +37,7 @@ public function __destruct() */ public function isReferenced(): bool { - return EventLoop::isReferenced($this->watcher); + return EventLoop::isReferenced($this->callbackId); } /** @@ -47,7 +47,7 @@ public function isReferenced(): bool */ public function reference(): self { - EventLoop::reference($this->watcher); + EventLoop::reference($this->callbackId); return $this; } @@ -59,7 +59,7 @@ public function reference(): self */ public function unreference(): self { - EventLoop::unreference($this->watcher); + EventLoop::unreference($this->callbackId); return $this; } @@ -69,7 +69,7 @@ public function unreference(): self */ public function isEnabled(): bool { - return EventLoop::isEnabled($this->watcher); + return EventLoop::isEnabled($this->callbackId); } /** @@ -79,7 +79,7 @@ public function isEnabled(): bool */ public function enable(): self { - EventLoop::enable($this->watcher); + EventLoop::enable($this->callbackId); return $this; } @@ -91,7 +91,7 @@ public function enable(): self */ public function disable(): self { - EventLoop::disable($this->watcher); + EventLoop::disable($this->callbackId); return $this; }