fix(stream): Fixed throwing CommunicationException when stream is EOF (#1548)

* fix(stream): Fixed return type to match function signature

* Updated CHANGELOG.md

* Fix syntax error

* Updated CHANGELOG.md entry
This commit is contained in:
Vladyslav Vildanov
2025-05-30 10:26:17 +03:00
committed by GitHub
parent 6021daf9cd
commit d7f60099a6
3 changed files with 4 additions and 2 deletions
+1
View File
@@ -7,6 +7,7 @@
### Fixed
- Fixed PHP 8.4 deprecated call to `stream_context_set_option()` (#1545)
- Fixed return type for `ZCOUNT` to be `int` (#1547)
- fix(stream): Fixed throwing `CommunicationException` when stream is EOF (#1548)
## v3.0.1 (2025-05-16)
### Fixed
+1 -1
View File
@@ -145,7 +145,7 @@ class StreamConnection extends AbstractConnection
$stream = $this->getResource();
if ($stream->eof()) {
$this->onStreamError(new RuntimeException('Stream is already at the end'), '');
$this->onStreamError(new RuntimeException('', 1), 'Stream is already at the end');
}
try {
@@ -15,6 +15,7 @@ namespace Predis\Connection;
use PHPUnit\Framework\MockObject\MockObject;
use Predis\Client;
use Predis\Command\RawCommand;
use Predis\CommunicationException;
use Predis\Connection\Resource\Exception\StreamInitException;
use Predis\Connection\Resource\StreamFactoryInterface;
use Predis\Consumer\Push\PushResponse;
@@ -463,7 +464,7 @@ class StreamConnectionTest extends PredisConnectionTestCase
$connection = new StreamConnection($parameters, $this->mockStreamFactory);
$this->expectException(RuntimeException::class);
$this->expectException(CommunicationException::class);
$this->expectExceptionMessage('Stream is already at the end');
$connection->read();