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