Deprecation: #101175 - Methods in VersionState

See forge#101175

Description

The methods \TYPO3\CMS\Core\Versioning\VersionState::cast() and \TYPO3\CMS\Core\Versioning\VersionState->equals() have been marked as deprecated.

Impact

Calling the methods \TYPO3\CMS\Core\Versioning\VersionState::cast() and \TYPO3\CMS\Core\Versioning\VersionState->equals() will trigger a PHP deprecation warning.

Affected installations

TYPO3 installations calling \TYPO3\CMS\Core\Versioning\VersionState::cast() and \TYPO3\CMS\Core\Versioning\VersionState->equals().

Migration

Before:

$versionState = \TYPO3\CMS\Core\Versioning\VersionState::cast($value);
if ($versionState->equals(VersionState::MOVE_POINTER) {
    // ...
}

After:

$versionState = \TYPO3\CMS\Core\Versioning\VersionState::tryFrom($value)
if ($versionState === VersionState::MOVE_POINTER) {
    // ...
}