| @@ 63-77 (lines=15) @@ | ||
| 60 | * |
|
| 61 | * @return \Graze\Dynamark3Client\Dynamark3ResponseInterface |
|
| 62 | */ |
|
| 63 | public function parseResponse(TelnetResponseInterface $response) |
|
| 64 | { |
|
| 65 | $errorCode = null; |
|
| 66 | $promptMatches = $response->getPromptMatches(); |
|
| 67 | $prompt = reset($promptMatches); |
|
| 68 | if ($response->isError()) { |
|
| 69 | // error prompt - ERROR nnn |
|
| 70 | $errorCode = substr($prompt, 6); |
|
| 71 | } |
|
| 72 | ||
| 73 | return new Dynamark3Response( |
|
| 74 | $prompt, |
|
| 75 | $errorCode |
|
| 76 | ); |
|
| 77 | } |
|
| 78 | } |
|
| 79 | ||
| @@ 42-52 (lines=11) @@ | ||
| 39 | * |
|
| 40 | * @return \Graze\Dynamark3Client\Dynamark3ResponseInterface |
|
| 41 | */ |
|
| 42 | public function parseResponse(TelnetResponseInterface $telnetResponse) |
|
| 43 | { |
|
| 44 | $promptMatches = $telnetResponse->getPromptMatches(); |
|
| 45 | $prompt = reset($promptMatches); |
|
| 46 | ||
| 47 | $response = parent::parseResponse($telnetResponse); |
|
| 48 | // prompt = RESULT GETXML <xml><something... |
|
| 49 | $response->setResponseText(substr($prompt, 14)); |
|
| 50 | ||
| 51 | return $response; |
|
| 52 | } |
|
| 53 | } |
|
| 54 | ||