‪TYPO3CMS  ‪main
InformationStatus.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
24 {
25  case NOTICE = '';
26  case INFO = 'info';
27  case OK = 'success';
28  case WARNING = 'warning';
29  case ERROR = 'danger';
30 
34  public function ‪isGreaterThan(‪InformationStatus $status): bool
35  {
36  return $this->getOrderRepresentation($this) > $this->getOrderRepresentation($status);
37  }
38 
39  private function getOrderRepresentation(‪InformationStatus $status): int
40  {
41  return match ($status) {
42  self::NOTICE => -2,
43  self::INFO => -1,
44  self::OK => 0,
45  self::WARNING => 1,
46  self::ERROR => 2,
47  };
48  }
49 }
‪TYPO3\CMS\Backend\Toolbar\InformationStatus
‪InformationStatus
Definition: InformationStatus.php:24
‪TYPO3\CMS\Backend\Toolbar
‪TYPO3\CMS\Backend\Toolbar\isGreaterThan
‪@ isGreaterThan
Definition: InformationStatus.php:34