filterArguments(); } public function parseResponse($data) { if ($this->isWithCountModifier()) { $result = []; for ($i = 0, $iMax = count($data); $i < $iMax; ++$i) { if (array_key_exists($i + 1, $data)) { $result[(string) $data[$i]] = $data[++$i]; } } return $result; } return $data; } /** * Checks for the presence of the WITHCOUNT modifier. * * @return bool */ private function isWithCountModifier(): bool { $arguments = $this->getArguments(); $lastArgument = (!empty($arguments)) ? $arguments[count($arguments) - 1] : null; return is_string($lastArgument) && strtoupper($lastArgument) === 'WITHCOUNT'; } }