Skip to content

Commit

Permalink
[TASK] Simplify isTypo3Version12() function
Browse files Browse the repository at this point in the history
  • Loading branch information
einpraegsam committed Nov 29, 2024
1 parent e681f4c commit ed65846
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions Classes/Utility/ConfigurationUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException;
use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationPathDoesNotExistException;
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\VersionNumberUtility;

class ConfigurationUtility
{
Expand Down Expand Up @@ -240,32 +240,8 @@ protected static function getExtensionConfiguration(): array
return GeneralUtility::makeInstance(ExtensionConfiguration::class)->get('lux');
}

/**
* Todo: Can be removed if TYPO3 12 support is dropped
*
* @return bool
*/
public static function isTypo3Version12(): bool
{
return self::isVersionToCompareSameOrHigherThenCurrentTypo3Version('12.4.99');
}

/**
* @param string $versionToCompare like "1.2.3"
* @return bool
*/
public static function isVersionToCompareSameOrHigherThenCurrentTypo3Version(string $versionToCompare): bool
{
return VersionNumberUtility::convertVersionNumberToInteger($versionToCompare) >= self::getCurrentTypo3Version();
}

/**
* Return current TYPO3 version as integer - e.g. 10003000 (10.3.0) or 9005014 (9.5.14)
*
* @return int
*/
protected static function getCurrentTypo3Version(): int
{
return VersionNumberUtility::convertVersionNumberToInteger(VersionNumberUtility::getNumericTypo3Version());
return (new Typo3Version())->getMajorVersion() === 12;
}
}

0 comments on commit ed65846

Please sign in to comment.