mirror of
https://github.com/predis/predis.git
synced 2026-08-30 12:15:03 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 675951360f | |||
| 0795d69d9e |
@@ -1,5 +1,11 @@
|
|||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
## Unlreleads
|
||||||
|
### Added
|
||||||
|
### Changed
|
||||||
|
### Fixed
|
||||||
|
- Fixed RESP3 double parsing returning positive `INF` for `-inf` payloads (#1716)
|
||||||
|
|
||||||
## v3.6.0 (2026-08-14)
|
## v3.6.0 (2026-08-14)
|
||||||
### Added
|
### Added
|
||||||
- Added support for new TS commands + Indonesian language support integration test (#1695)
|
- Added support for new TS commands + Indonesian language support integration test (#1695)
|
||||||
|
|||||||
+1
-1
@@ -56,7 +56,7 @@ use Traversable;
|
|||||||
*/
|
*/
|
||||||
class Client implements ClientInterface, IteratorAggregate
|
class Client implements ClientInterface, IteratorAggregate
|
||||||
{
|
{
|
||||||
public const VERSION = '3.6.0';
|
public const VERSION = '3.6.1-dev';
|
||||||
|
|
||||||
/** @var OptionsInterface */
|
/** @var OptionsInterface */
|
||||||
private $options;
|
private $options;
|
||||||
|
|||||||
@@ -63,10 +63,14 @@ class Resp3Strategy extends Resp2Strategy
|
|||||||
*/
|
*/
|
||||||
protected function parseDouble(string $string): float
|
protected function parseDouble(string $string): float
|
||||||
{
|
{
|
||||||
if ($string === 'inf' || $string === '-inf') {
|
if ($string === 'inf') {
|
||||||
return INF;
|
return INF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($string === '-inf') {
|
||||||
|
return -INF;
|
||||||
|
}
|
||||||
|
|
||||||
return (float) $string;
|
return (float) $string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,11 +60,11 @@ class Resp3StrategyTest extends PredisTestCase
|
|||||||
* @param string $data
|
* @param string $data
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testParseDataReturnsFloatInfinityOnInfinityOrNegativeInfinity(string $data): void
|
public function testParseDataReturnsFloatInfinityOnInfinityOrNegativeInfinity(string $data, float $expectedValue): void
|
||||||
{
|
{
|
||||||
$actualResponse = $this->strategy->parseData($data);
|
$actualResponse = $this->strategy->parseData($data);
|
||||||
|
|
||||||
$this->assertInfinite($actualResponse);
|
$this->assertSame($expectedValue, $actualResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -166,8 +166,8 @@ class Resp3StrategyTest extends PredisTestCase
|
|||||||
public function infinityProvider(): array
|
public function infinityProvider(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'positive infinity' => [",inf\r\n"],
|
'positive infinity' => [",inf\r\n", INF],
|
||||||
'negative infinity' => [",-inf\r\n"],
|
'negative infinity' => [",-inf\r\n", -INF],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user