From 97e646fda49a47c2a918472b43c5d9638f960ff8 Mon Sep 17 00:00:00 2001 From: the-djmaze <3752035+the-djmaze@users.noreply.github.com> Date: Tue, 27 Oct 2026 20:43:03 +0100 Subject: [PATCH] Use `mixed` return type --- .../app/libraries/snappymail/gpg/procpipes.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/snappymail/v/0.0.0/app/libraries/snappymail/gpg/procpipes.php b/snappymail/v/0.0.0/app/libraries/snappymail/gpg/procpipes.php index 1d0c02d3d..579b9586e 100644 --- a/snappymail/v/0.0.0/app/libraries/snappymail/gpg/procpipes.php +++ b/snappymail/v/0.0.0/app/libraries/snappymail/gpg/procpipes.php @@ -26,21 +26,20 @@ class ProcPipes $this->closeAll(); } - public function closeAll() : void + public function closeAll(): void { - foreach (\array_keys($this->pipes) as $number) { - $this->close($number); - } + $this->pipes && \array_all($this->pipes, [$this, 'close']); + $this->pipes = []; } - public function get(int $number) + public function get(int $number): mixed { if (\array_key_exists($number, $this->pipes) && \is_resource($this->pipes[$number])) { return $this->pipes[$number]; } } - public function close(int $number) : void + public function close(int $number): void { if (\array_key_exists($number, $this->pipes)) { \fflush($this->pipes[$number]); @@ -50,7 +49,7 @@ class ProcPipes } private $buffers = []; - public function readPipeLines(int $number) : iterable + public function readPipeLines(int $number): iterable { $pipe = $this->get($number); if ($pipe) { @@ -68,7 +67,7 @@ class ProcPipes } } - public function writePipe(int $number, string $data, int $length = 0) : int + public function writePipe(int $number, string $data, int $length = 0): int { $pipe = $this->get($number); if ($pipe) {