title = (string)$title; $this->value = (string)$value; $this->message = (string)$message; $this->severity = $severity; } /** * Gets the status' title * * @return string */ public function getTitle() { return $this->title; } /** * Gets the status' value * * @return string */ public function getValue() { return $this->value; } /** * Gets the status' message (if any) * * @return string */ public function getMessage() { return $this->message; } public function getSeverity(): ContextualFeedbackSeverity { return $this->severity; } /** * Creates a string representation of a status. * * @return string String representation of this status. */ public function __toString() { // Max length 80 characters $stringRepresentation = str_pad('[' . $this->severity->name . ']', 7) . str_pad($this->title, 40) . ' - ' . substr($this->value, 0, 30); return $stringRepresentation; } }