/** * @param TelnetResponseInterface $response * * @return \Graze\Dynamark3Client\Dynamark3ResponseInterface */ public function parseResponse(TelnetResponseInterface $response) { $errorCode = null; $promptMatches = $response->getPromptMatches(); $prompt = reset($promptMatches); if ($response->isError()) { // error prompt - ERROR nnn $errorCode = substr($prompt, 6); } return new Dynamark3Response($prompt, $errorCode); }