From fc423c7db5d3692ed10f0d1fdcb2eb6b1e7d0ac3 Mon Sep 17 00:00:00 2001 From: Niklas Keller Date: Sun, 25 Oct 2020 21:44:01 +0100 Subject: [PATCH] Remove static to access $this --- lib/CombinedCancellationToken.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/CombinedCancellationToken.php b/lib/CombinedCancellationToken.php index 34033ed..00b5f2c 100644 --- a/lib/CombinedCancellationToken.php +++ b/lib/CombinedCancellationToken.php @@ -24,7 +24,7 @@ final class CombinedCancellationToken implements CancellationToken $this->callbacks = []; foreach ($callbacks as $callback) { - Loop::defer(static fn (): Promise => call($callback, $this->exception)); + Loop::defer(fn(): Promise => call($callback, $this->exception)); } }); @@ -34,7 +34,7 @@ final class CombinedCancellationToken implements CancellationToken public function __destruct() { - foreach ($this->tokens as list($token, $id)) { + foreach ($this->tokens as [$token, $id]) { /** @var CancellationToken $token */ $token->unsubscribe($id); } @@ -46,7 +46,7 @@ final class CombinedCancellationToken implements CancellationToken $id = $this->nextId++; if (isset($this->exception)) { - Loop::defer(static fn (): Promise => call($callback, $this->exception)); + Loop::defer(fn(): Promise => call($callback, $this->exception)); } else { $this->callbacks[$id] = $callback; } @@ -63,7 +63,7 @@ final class CombinedCancellationToken implements CancellationToken /** @inheritdoc */ public function isRequested(): bool { - foreach ($this->tokens as list($token)) { + foreach ($this->tokens as [$token]) { if ($token->isRequested()) { return true; } @@ -75,7 +75,7 @@ final class CombinedCancellationToken implements CancellationToken /** @inheritdoc */ public function throwIfRequested(): void { - foreach ($this->tokens as list($token)) { + foreach ($this->tokens as [$token]) { $token->throwIfRequested(); } }