name = $name; $this->severity = $severity; } /** * @return string */ public function getName(): string { return $this->name; } /** * @return string */ public function getSeverity(): string { return $this->severity; } /** * @return bool */ public function isSuccess(): bool { return $this->success; } /** * @param bool $success * * @return Test */ public function setSuccess(bool $success): self { $this->success = $success; return $this; } /** * @return array */ public function getMessages(): array { return $this->messages; } /** * @param string $message * * @return Test */ public function addMessage(string $message): self { $this->messages[] = $message; return $this; } /** * @return array */ public function jsonSerialize(): array { $result = array_filter( [ 'name' => $this->getName(), 'severity' => $this->getSeverity(), 'details' => $this->gAll(), 'message' => $this->getMessages() ] ); $result['success'] = $this->isSuccess(); return $result; } }