4
0

Log.php 767 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. declare(strict_types=1);
  3. class FreshRSS_Log extends Minz_Model {
  4. private string $date;
  5. /** @property 'error'|'warning'|'notice'|'debug'|'info' $level */
  6. private string $level;
  7. private string $information;
  8. public function date(): string {
  9. return $this->date;
  10. }
  11. public function level(): string {
  12. return $this->level;
  13. }
  14. public function info(): string {
  15. return $this->information;
  16. }
  17. public function _date(string $date): void {
  18. $this->date = $date;
  19. }
  20. public function _level(string $level): void {
  21. if (!in_array($level, ['error', 'warning', 'notice', 'debug', 'info'], true)) {
  22. $this->level = 'info';
  23. return;
  24. }
  25. $this->level = $level;
  26. }
  27. public function _info(string $information): void {
  28. $this->information = $information;
  29. }
  30. }