Skip to content

Commit

Permalink
[BUGFIX] Ignore TYPO3v12 code to satisfy PHPStan on TYPO3 v11
Browse files Browse the repository at this point in the history
  • Loading branch information
Sascha Löffler committed Jun 26, 2024
1 parent 33c2763 commit 6d7c572
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Classes/Controller/Backend/ImageRecognizeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,8 @@ public function getLocaleLanguageCode(SiteLanguage $siteLanguage): string
{
$version = GeneralUtility::makeInstance(VersionNumberUtility::class)->getNumericTypo3Version();
if (version_compare($version, '12.0', '>=')) {
$locale = $siteLanguage->getLocale();
if (method_exists($locale, 'getLanguageCode')) { // satisfy PHPStan for TYPO3 v11
return $locale->getLanguageCode();
}
// @phpstan-ignore-next-line Stop PHPStan about complaining this line for TYPO3 v11
return $siteLanguage->getLocale()->getLanguageCode();
}
return $siteLanguage->getTwoLetterIsoCode();
}
Expand Down

0 comments on commit 6d7c572

Please sign in to comment.