From c51a4362e952092dd078cfc55c42243bc7940c31 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Mon, 7 Aug 2023 12:59:42 +0200 Subject: [PATCH] Moving suppressions for unused return values to individual methods --- test/TestAsset/MockStreamHelper.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/TestAsset/MockStreamHelper.php b/test/TestAsset/MockStreamHelper.php index 49a5cfa..6a7b36f 100644 --- a/test/TestAsset/MockStreamHelper.php +++ b/test/TestAsset/MockStreamHelper.php @@ -11,7 +11,8 @@ use const SEEK_SET; /** - * @psalm-suppress PossiblyUnusedMethod,PossiblyUnusedParam,PossiblyUnusedReturnValue + * @psalm-suppress PossiblyUnusedMethod + * @psalm-suppress PossiblyUnusedParam */ class MockStreamHelper { @@ -35,22 +36,26 @@ public function __construct( $this->trackPeakBufferLength = $trackPeakBufferLength; } + /** @psalm-suppress PossiblyUnusedReturnValue */ public function handleToString(): string { $this->position = $this->size; return is_callable($this->contents) ? ($this->contents)(0) : $this->contents; } + /** @psalm-suppress PossiblyUnusedReturnValue */ public function handleTell(): int { return $this->position; } + /** @psalm-suppress PossiblyUnusedReturnValue */ public function handleEof(): bool { return $this->position >= $this->size; } + /** @psalm-suppress PossiblyUnusedReturnValue */ public function handleSeek(int $offset, ?int $whence = SEEK_SET): bool { if ($offset >= $this->size) { @@ -61,12 +66,14 @@ public function handleSeek(int $offset, ?int $whence = SEEK_SET): bool return true; } + /** @psalm-suppress PossiblyUnusedReturnValue */ public function handleRewind(): bool { $this->position = 0; return true; } + /** @psalm-suppress PossiblyUnusedReturnValue */ public function handleRead(int $length): string { if ($this->trackPeakBufferLength) { @@ -82,6 +89,7 @@ public function handleRead(int $length): string return $data; } + /** @psalm-suppress PossiblyUnusedReturnValue */ public function handleGetContents(): string { $remainingContents = is_callable($this->contents)