src/mako/redis/Connection.php
public function read(int $bytes): string
	{
		$bytesLeft = $bytes;

		$data = '';

		do
		{
			$chunk = fread($this->connection, min($bytesLeft, 4096));

			if($chunk === false || $chunk === '')
			{
				throw new RedisException($this->appendReadErrorReason('Failed to read data from the server.'));
			}

			$data .= $chunk;

			$bytesLeft = $bytes - strlen($data);
		}
		while($bytesLeft > 0);

		return $data;
	}
public function read(int $bytes): string
	{
		$bytesLeft = $bytes;

		$data = '';

		do
		{
			$chunk = fread($this->connection, min($bytesLeft, 4096));

			if($chunk === false || $chunk === '')
			{
				throw new RedisException($this->appendReadErrorReason('Failed to read data from the server.'));
			}

			$data .= $chunk;

			$bytesLeft = $bytes - strlen($data);
		}
		while($bytesLeft > 0);

		return $data;
	}
public function read ( int $ bytes ) : string { $ bytesLeft = $ bytes ; $ data = '' ; do { $ chunk = fread ( $ this -> connection , min ( $ bytesLeft , 4096 ) ) ; if ( $ chunk === false || $ chunk === '' ) { throw new RedisException ( $ this -> appendReadErrorReason ( 'Failed to read data from the server.' ) ) ; } $ data .= $ chunk ; $ bytesLeft = $ bytes - strlen ( $ data ) ; } while ( $ bytesLeft > 0 ) ; return $ data ; }
Reads n bytes from the server.

@param  int                        $bytes Number of bytes to read
@throws \mako\redis\RedisException
@return string
Reads n bytes from the server .