mirror of
https://github.com/predis/predis.git
synced 2026-08-19 18:22:06 +00:00
Implement Predis\Command::__toString().
This commit is contained in:
@@ -62,4 +62,15 @@ abstract class Command implements ICommand {
|
||||
public function parseResponse($data) {
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function __toString() {
|
||||
$reducer = function($acc, $arg) {
|
||||
if (strlen($arg) > 32) {
|
||||
$arg = substr($arg, 0, 32) . '[...]';
|
||||
}
|
||||
$acc .= " $arg";
|
||||
return $acc;
|
||||
};
|
||||
return array_reduce($this->getArguments(), $reducer, $this->getCommandId());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user