<?php

namespace EasySwoole\Redis\CommandHandle;

use EasySwoole\Redis\CommandConst;
use EasySwoole\Redis\Redis;
use EasySwoole\Redis\Response;

class SDiff extends AbstractCommandHandle
{
    public $commandName = 'SDiff';


    public function handelCommandData(...$data)
    {
        $key1 = array_shift($data);

        $command = [CommandConst::SDIFF, $key1];
        $commandData = array_merge($command, $data);
        return $commandData;
    }


    public function handelRecv(Response $recv)
    {
        $data = $recv->getData();
        foreach ($data as $key => $value) {
            $data[$key] = $this->unSerialize($value);
        }
        return $data;
    }
}
