Feature: #97787 - Enum for severities introduced
See forge#97787
Description
The PHP enum \TYPO3\
has been
introduced, allowing streamlined usage of severities across the codebase. At the
time of writing, this affects flash messages and status reports used in
EXT:reports.
Impact
The enum cases in \TYPO3\
are
meant to be a drop-in replacement for the severity constants of
\TYPO3\
and \TYPO3\
.
Example
Example of using the enum in a flash message:
$flashMessage = GeneralUtility::makeInstance(
\TYPO3\CMS\Core\Messaging\FlashMessage::class,
'Flash message text',
'This is fine',
\TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::OK
);
Copied!
Example of using the enum in a status report:
$statusReport = GeneralUtility::makeInstance(
\TYPO3\CMS\Reports\Status::class,
'Lemming-o-meter',
'Oops',
'Not all lemmings were saved!',
\TYPO3\CMS\Core\Type\ContextualFeedbackSeverity::WARNING
);
Copied!