json = json_decode($json, false); } else { throw new \Exception("JSON is required to use this class"); } } public function getMessage() { return $this->json->text; } } ?>