/** * Encode array to JSON. * * @param array $document * * @return string */ protected function encodeToJson(array $document) { return $this->encoderOptions === null ? json_encode($document) : json_encode($document, $this->encoderOptions->getOptions(), $this->encoderOptions->getDepth()); }
/** * @param DocumentInterface $docWriter */ private function configureUrlPrefix(DocumentInterface $docWriter) { $this->encoderOptions !== null && $this->encoderOptions->getUrlPrefix() !== null ? $docWriter->setUrlPrefix($this->encoderOptions->getUrlPrefix()) : null; }