public function encodeResponsesCollection(array $responses) { $formatted = []; foreach ($responses as $response) { $formatted[] = $this->formatResponse($response); } return json_encode($formatted, JSON_PRETTY_PRINT); }
/** * Returns the content of a specific tape without writing it to disk. * * @param string $name * * @return null|string */ public function getTapeContent($name) { $tape = $this->getTape($name); if ($tape->hasResponses()) { $content = $this->formatter->encodeResponsesCollection($tape->getResponses()); return $content; } return; }