26 lines
435 B
PHP
26 lines
435 B
PHP
<?php
|
|
|
|
class Status
|
|
{
|
|
private static array $messages = [];
|
|
|
|
public static function set(string $message)
|
|
{
|
|
self::$messages[] = $message;
|
|
}
|
|
|
|
public static function get(): string
|
|
{
|
|
return implode('<br>', self::$messages);
|
|
}
|
|
|
|
public static function print()
|
|
{
|
|
echo self::get();
|
|
}
|
|
|
|
public static function exists(): bool
|
|
{
|
|
return !empty(self::$messages);
|
|
}
|
|
} |