Breaking: #101131 - Convert LoginType to native backed enum
See forge#101131
Description
The class \TYPO3\
is now
converted to a native backed enum.
Impact
Since \TYPO3\
is no longer
a class, the existing class constants are no longer available.
Affected installations
Custom authenticators using the following class constants:
\TYPO3\
CMS\ Core\ Authentication\ Login Type:: LOGIN \TYPO3\
CMS\ Core\ Authentication\ Login Type:: LOGOUT
Migration
Use the new syntax:
\TYPO3\
\TYPO3\
Alternatively, use the enum method try
to convert a
value to an enum. For direct comparison of two enums, the null-coalescing
operator shall be used to ensure that the parameter is a string:
<?php
use TYPO3\CMS\Core\Authentication\LoginType;
if (LoginType::tryFrom($value ?? '') === LoginType::LOGIN) {
// Do login stuff
}
if (LoginType::tryFrom($value ?? '') === LoginType::LOGOUT) {
// Do logout stuff
}
Copied!