Please sign in to comment.
Move command response parsing to the client class.
Connection classes should just handle, convert and return simple Redis types while parsing and transforming structured replies should be done by consumers (see Predis\Client or Predis\Transaction\MultiExecContext). This actually makes more sense considering that parsing a complex response with the associated command parser may require different actions. As an example, the result of EXEC is a multibulk that holds the actual responses, so we really need to parse each one of its elements and we should also make sure that iterable multibulks are consumed. We already did that previously, but it was weird knowing that command parsers were applied by the connection class. This also moves some duplicated logic away from each connection class implementation which is a nice bonus.
- Loading branch information...
Showing with 51 additions and 62 deletions.
- +14 −6 lib/Predis/Client.php
- +1 −8 lib/Predis/Connection/AbstractConnection.php
- +3 −12 lib/Predis/Connection/WebdisConnection.php
- +18 −29 tests/PHPUnit/ConnectionTestCase.php
- +13 −5 tests/Predis/ClientTest.php
- +1 −1 tests/Predis/Connection/PhpiredisConnectionTest.php
- +1 −1 tests/Predis/Connection/WebdisConnectionTest.php