diff --git a/src/Rector/v11/v0/RemoveLanguageModeMethodsFromTypo3QuerySettingsRector.php b/src/Rector/v11/v0/RemoveLanguageModeMethodsFromTypo3QuerySettingsRector.php index 17876aa68..fd59ffbcf 100644 --- a/src/Rector/v11/v0/RemoveLanguageModeMethodsFromTypo3QuerySettingsRector.php +++ b/src/Rector/v11/v0/RemoveLanguageModeMethodsFromTypo3QuerySettingsRector.php @@ -53,7 +53,7 @@ public function refactor(Node $node): ?Node { if (! $this->nodeTypeResolver->isMethodStaticCallOrClassMethodObjectType( $node, - new ObjectType('TYPO3\CMS\Extbase\Persistence\Generic\Typo3QuerySettings') + new ObjectType('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\QuerySettingsInterface') )) { return null; } diff --git a/stubs/TYPO3/CMS/Extbase/Persistence/Generic/QuerySettingsInterface.php b/stubs/TYPO3/CMS/Extbase/Persistence/Generic/QuerySettingsInterface.php index ad22ce3ca..29a2eb742 100644 --- a/stubs/TYPO3/CMS/Extbase/Persistence/Generic/QuerySettingsInterface.php +++ b/stubs/TYPO3/CMS/Extbase/Persistence/Generic/QuerySettingsInterface.php @@ -4,6 +4,10 @@ namespace TYPO3\CMS\Extbase\Persistence\Generic; +if (interface_exists('TYPO3\CMS\Extbase\Persistence\Generic\QuerySettingsInterface')) { + return; +} + interface QuerySettingsInterface { diff --git a/stubs/TYPO3/CMS/Extbase/Persistence/Generic/Typo3QuerySettings.php b/stubs/TYPO3/CMS/Extbase/Persistence/Generic/Typo3QuerySettings.php index cf9036a05..9caf21a1c 100644 --- a/stubs/TYPO3/CMS/Extbase/Persistence/Generic/Typo3QuerySettings.php +++ b/stubs/TYPO3/CMS/Extbase/Persistence/Generic/Typo3QuerySettings.php @@ -5,7 +5,7 @@ return; } -class Typo3QuerySettings +class Typo3QuerySettings implements QuerySettingsInterface { /** * @var int diff --git a/tests/Rector/v11/v0/RemoveLanguageModeMethodsFromTypo3QuerySettingsRector/Fixture/remove_language_mode_methods.php.inc b/tests/Rector/v11/v0/RemoveLanguageModeMethodsFromTypo3QuerySettingsRector/Fixture/remove_language_mode_methods.php.inc index 3a1414d7a..3d8fd66cb 100644 --- a/tests/Rector/v11/v0/RemoveLanguageModeMethodsFromTypo3QuerySettingsRector/Fixture/remove_language_mode_methods.php.inc +++ b/tests/Rector/v11/v0/RemoveLanguageModeMethodsFromTypo3QuerySettingsRector/Fixture/remove_language_mode_methods.php.inc @@ -8,6 +8,7 @@ $querySettings = new Typo3QuerySettings(); $querySettings->setLanguageMode(); $querySettings->setLanguageMode()->setLanguageUid(0); $querySettings->setLanguageUid(0)->setLanguageMode()->getLanguageMode(); +$querySettings->setLanguageMode('ignore'); ?> -----