RestContext::theResponseIsJson PHP Метод

theResponseIsJson() публичный Метод

public theResponseIsJson ( string $notJson = '' ) : void
$notJson string
Результат void
    public function theResponseIsJson($notJson = '')
    {
        $this->processResponse();
        if (strpos($notJson, 'not') === false) {
            if (!$this->responseIsJson) {
                $message = "Response was not JSON\n";
                if (!empty($this->responseDecodeException)) {
                    $message .= $this->responseDecodeException->getMessage();
                }
                throw new \Exception($message . "\n" . $this->response);
            }
        } else {
            if ($this->responseIsJson) {
                throw new \Exception("Response was JSON\n" . $this->response);
            }
        }
    }