From 2513b346a506c9fd8580d44111abc87b9a84d5e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BCrk?= Date: Thu, 19 Dec 2024 16:43:00 +0100 Subject: [PATCH] [TASK] Add TYPO3 v13 code phpstan errors for TYPO3v12 to baseline PHPStan does not understand or respect TYPO3 version conditional based code to make code flows based on the TYPO3 version, which leads to false-positive error reportings. Until a better solution can be provided, we need to add them to the depending phpstan baseline file. Used command(s): ```bash Build/Scripts/runTests.sh -t 12 -p 8.2 -s composerUpdate Build/Scripts/runTests.sh -t 12 -p 8.2 -s phpstanGenerateBaseline Build/Scripts/runTests.sh -t 13 -p 8.2 -s composerUpdate Build/Scripts/runTests.sh -t 13 -p 8.2 -s phpstanGenerateBaseline ``` --- Build/Scripts/composer-for-core-version.sh | 1 + Build/phpstan/Core12/phpstan-baseline.neon | 120 ++++++++++++++++++++ Build/phpstan/Core13/phpstan-baseline.neon | 90 +++++++++++++++ Classes/Upgrades/FormalityUpgradeWizard.php | 14 ++- 4 files changed, 219 insertions(+), 6 deletions(-) diff --git a/Build/Scripts/composer-for-core-version.sh b/Build/Scripts/composer-for-core-version.sh index 1532abc5..60044e0d 100755 --- a/Build/Scripts/composer-for-core-version.sh +++ b/Build/Scripts/composer-for-core-version.sh @@ -6,6 +6,7 @@ composer_cleanup() { echo -e "💥 Cleanup folders" rm -Rf \ + .cache/phpstan/* \ .Build/vendor/* \ .Build/var/* \ .Build/bin/* \ diff --git a/Build/phpstan/Core12/phpstan-baseline.neon b/Build/phpstan/Core12/phpstan-baseline.neon index 3bb73956..4bc67bfb 100644 --- a/Build/phpstan/Core12/phpstan-baseline.neon +++ b/Build/phpstan/Core12/phpstan-baseline.neon @@ -40,6 +40,11 @@ parameters: count: 1 path: ../../../Classes/Service/LanguageService.php + - + message: "#^Call to method write\\(\\) on an unknown class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteWriter\\.$#" + count: 1 + path: ../../../Classes/Upgrades/FormalityUpgradeWizard.php + - message: "#^Method WebVision\\\\Deepltranslate\\\\Core\\\\Utility\\\\DeeplBackendUtility\\:\\:buildBackendRoute\\(\\) has parameter \\$parameters with no value type specified in iterable type array\\.$#" count: 1 @@ -105,6 +110,16 @@ parameters: count: 1 path: ../../../Tests/Functional/Fixtures/Frontend/PhpError.php + - + message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor invoked with 7 parameters, 2\\-3 required\\.$#" + count: 1 + path: ../../../Tests/Functional/Hooks/TranslateHookTest.php + + - + message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Site\\\\Set\\\\SetRegistry not found\\.$#" + count: 1 + path: ../../../Tests/Functional/Hooks/TranslateHookTest.php + - message: "#^Method WebVision\\\\Deepltranslate\\\\Core\\\\Tests\\\\Functional\\\\Hooks\\\\TranslateHookTest\\:\\:buildDefaultLanguageConfiguration\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -155,6 +170,26 @@ parameters: count: 1 path: ../../../Tests/Functional/Hooks/TranslateHookTest.php + - + message: "#^Parameter \\#2 \\$eventDispatcher of class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor expects Psr\\\\EventDispatcher\\\\EventDispatcherInterface, TYPO3\\\\CMS\\\\Core\\\\Site\\\\SiteSettingsFactory given\\.$#" + count: 1 + path: ../../../Tests/Functional/Hooks/TranslateHookTest.php + + - + message: "#^Parameter \\#3 \\$coreCache of class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor expects TYPO3\\\\CMS\\\\Core\\\\Cache\\\\Frontend\\\\PhpFrontend\\|null, TYPO3\\\\CMS\\\\Core\\\\Site\\\\Set\\\\SetRegistry given\\.$#" + count: 1 + path: ../../../Tests/Functional/Hooks/TranslateHookTest.php + + - + message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor invoked with 7 parameters, 2\\-3 required\\.$#" + count: 1 + path: ../../../Tests/Functional/Regression/LocalizationInlineRegressionTest.php + + - + message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Site\\\\Set\\\\SetRegistry not found\\.$#" + count: 1 + path: ../../../Tests/Functional/Regression/LocalizationInlineRegressionTest.php + - message: "#^Method WebVision\\\\Deepltranslate\\\\Core\\\\Tests\\\\Functional\\\\Regression\\\\LocalizationInlineRegressionTest\\:\\:buildDefaultLanguageConfiguration\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -205,6 +240,26 @@ parameters: count: 1 path: ../../../Tests/Functional/Regression/LocalizationInlineRegressionTest.php + - + message: "#^Parameter \\#2 \\$eventDispatcher of class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor expects Psr\\\\EventDispatcher\\\\EventDispatcherInterface, TYPO3\\\\CMS\\\\Core\\\\Site\\\\SiteSettingsFactory given\\.$#" + count: 1 + path: ../../../Tests/Functional/Regression/LocalizationInlineRegressionTest.php + + - + message: "#^Parameter \\#3 \\$coreCache of class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor expects TYPO3\\\\CMS\\\\Core\\\\Cache\\\\Frontend\\\\PhpFrontend\\|null, TYPO3\\\\CMS\\\\Core\\\\Site\\\\Set\\\\SetRegistry given\\.$#" + count: 1 + path: ../../../Tests/Functional/Regression/LocalizationInlineRegressionTest.php + + - + message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor invoked with 7 parameters, 2\\-3 required\\.$#" + count: 1 + path: ../../../Tests/Functional/Regression/PreviewTranslationInformationTest.php + + - + message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Site\\\\Set\\\\SetRegistry not found\\.$#" + count: 1 + path: ../../../Tests/Functional/Regression/PreviewTranslationInformationTest.php + - message: "#^Method WebVision\\\\Deepltranslate\\\\Core\\\\Tests\\\\Functional\\\\Regression\\\\PreviewTranslationInformationTest\\:\\:buildDefaultLanguageConfiguration\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -255,11 +310,31 @@ parameters: count: 1 path: ../../../Tests/Functional/Regression/PreviewTranslationInformationTest.php + - + message: "#^Parameter \\#2 \\$eventDispatcher of class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor expects Psr\\\\EventDispatcher\\\\EventDispatcherInterface, TYPO3\\\\CMS\\\\Core\\\\Site\\\\SiteSettingsFactory given\\.$#" + count: 1 + path: ../../../Tests/Functional/Regression/PreviewTranslationInformationTest.php + + - + message: "#^Parameter \\#3 \\$coreCache of class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor expects TYPO3\\\\CMS\\\\Core\\\\Cache\\\\Frontend\\\\PhpFrontend\\|null, TYPO3\\\\CMS\\\\Core\\\\Site\\\\Set\\\\SetRegistry given\\.$#" + count: 1 + path: ../../../Tests/Functional/Regression/PreviewTranslationInformationTest.php + - message: "#^Cannot access property \\$code on DeepL\\\\Language\\|null\\.$#" count: 7 path: ../../../Tests/Functional/Services/DeeplServiceTest.php + - + message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor invoked with 7 parameters, 2\\-3 required\\.$#" + count: 1 + path: ../../../Tests/Functional/Services/LanguageServiceTest.php + + - + message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Site\\\\Set\\\\SetRegistry not found\\.$#" + count: 1 + path: ../../../Tests/Functional/Services/LanguageServiceTest.php + - message: "#^Method WebVision\\\\Deepltranslate\\\\Core\\\\Tests\\\\Functional\\\\Services\\\\LanguageServiceTest\\:\\:buildDefaultLanguageConfiguration\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -310,6 +385,26 @@ parameters: count: 1 path: ../../../Tests/Functional/Services/LanguageServiceTest.php + - + message: "#^Parameter \\#2 \\$eventDispatcher of class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor expects Psr\\\\EventDispatcher\\\\EventDispatcherInterface, TYPO3\\\\CMS\\\\Core\\\\Site\\\\SiteSettingsFactory given\\.$#" + count: 1 + path: ../../../Tests/Functional/Services/LanguageServiceTest.php + + - + message: "#^Parameter \\#3 \\$coreCache of class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor expects TYPO3\\\\CMS\\\\Core\\\\Cache\\\\Frontend\\\\PhpFrontend\\|null, TYPO3\\\\CMS\\\\Core\\\\Site\\\\Set\\\\SetRegistry given\\.$#" + count: 1 + path: ../../../Tests/Functional/Services/LanguageServiceTest.php + + - + message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor invoked with 7 parameters, 2\\-3 required\\.$#" + count: 1 + path: ../../../Tests/Functional/Updates/FormalityUpgradeWizardTest.php + + - + message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Site\\\\Set\\\\SetRegistry not found\\.$#" + count: 1 + path: ../../../Tests/Functional/Updates/FormalityUpgradeWizardTest.php + - message: "#^Method WebVision\\\\Deepltranslate\\\\Core\\\\Tests\\\\Functional\\\\Updates\\\\FormalityUpgradeWizardTest\\:\\:buildDefaultLanguageConfiguration\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -359,3 +454,28 @@ parameters: message: "#^Method WebVision\\\\Deepltranslate\\\\Core\\\\Tests\\\\Functional\\\\Updates\\\\FormalityUpgradeWizardTest\\:\\:writeSiteConfiguration\\(\\) has parameter \\$site with no value type specified in iterable type array\\.$#" count: 1 path: ../../../Tests/Functional/Updates/FormalityUpgradeWizardTest.php + + - + message: "#^Parameter \\#2 \\$eventDispatcher of class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor expects Psr\\\\EventDispatcher\\\\EventDispatcherInterface, TYPO3\\\\CMS\\\\Core\\\\Site\\\\SiteSettingsFactory given\\.$#" + count: 1 + path: ../../../Tests/Functional/Updates/FormalityUpgradeWizardTest.php + + - + message: "#^Parameter \\#3 \\$coreCache of class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor expects TYPO3\\\\CMS\\\\Core\\\\Cache\\\\Frontend\\\\PhpFrontend\\|null, TYPO3\\\\CMS\\\\Core\\\\Site\\\\Set\\\\SetRegistry given\\.$#" + count: 1 + path: ../../../Tests/Functional/Updates/FormalityUpgradeWizardTest.php + + - + message: "#^Call to method create\\(\\) on an unknown class TYPO3\\\\CMS\\\\Core\\\\View\\\\ViewFactoryInterface\\.$#" + count: 1 + path: ../../../Tests/Functional/ViewHelpers/ExtensionActiveViewHelperTest.php + + - + message: "#^Class TYPO3\\\\CMS\\\\Core\\\\View\\\\ViewFactoryInterface not found\\.$#" + count: 1 + path: ../../../Tests/Functional/ViewHelpers/ExtensionActiveViewHelperTest.php + + - + message: "#^Instantiated class TYPO3\\\\CMS\\\\Core\\\\View\\\\ViewFactoryData not found\\.$#" + count: 1 + path: ../../../Tests/Functional/ViewHelpers/ExtensionActiveViewHelperTest.php diff --git a/Build/phpstan/Core13/phpstan-baseline.neon b/Build/phpstan/Core13/phpstan-baseline.neon index 3bb73956..d7c96ceb 100644 --- a/Build/phpstan/Core13/phpstan-baseline.neon +++ b/Build/phpstan/Core13/phpstan-baseline.neon @@ -1,10 +1,20 @@ parameters: ignoreErrors: + - + message: "#^Call to an undefined method TYPO3\\\\CMS\\\\Frontend\\\\Controller\\\\TypoScriptFrontendController\\:\\:getContext\\(\\)\\.$#" + count: 1 + path: ../../../Classes/Event/Listener/RenderTranslatedFlagInFrontendPreviewMode.php + - message: "#^Method WebVision\\\\Deepltranslate\\\\Core\\\\Form\\\\Item\\\\SiteConfigSupportedLanguageItemsProcFunc\\:\\:getSupportedLanguageForField\\(\\) has parameter \\$configuration with no value type specified in iterable type array\\.$#" count: 1 path: ../../../Classes/Form/Item/SiteConfigSupportedLanguageItemsProcFunc.php + - + message: "#^Parameter \\#3 \\$severity of class TYPO3\\\\CMS\\\\Core\\\\Messaging\\\\FlashMessage constructor expects TYPO3\\\\CMS\\\\Core\\\\Type\\\\ContextualFeedbackSeverity, int given\\.$#" + count: 1 + path: ../../../Classes/Hooks/AbstractTranslateHook.php + - message: "#^Method WebVision\\\\Deepltranslate\\\\Core\\\\Hooks\\\\ButtonBarHook\\:\\:buildParamsArrayForListView\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -105,6 +115,16 @@ parameters: count: 1 path: ../../../Tests/Functional/Fixtures/Frontend/PhpError.php + - + message: "#^Call to an undefined method TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration\\:\\:write\\(\\)\\.$#" + count: 2 + path: ../../../Tests/Functional/Hooks/TranslateHookTest.php + + - + message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor invoked with 3 parameters, 7 required\\.$#" + count: 1 + path: ../../../Tests/Functional/Hooks/TranslateHookTest.php + - message: "#^Method WebVision\\\\Deepltranslate\\\\Core\\\\Tests\\\\Functional\\\\Hooks\\\\TranslateHookTest\\:\\:buildDefaultLanguageConfiguration\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -155,6 +175,21 @@ parameters: count: 1 path: ../../../Tests/Functional/Hooks/TranslateHookTest.php + - + message: "#^Parameter \\#2 \\$siteSettingsFactory of class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor expects TYPO3\\\\CMS\\\\Core\\\\Site\\\\SiteSettingsFactory, Psr\\\\EventDispatcher\\\\EventDispatcherInterface given\\.$#" + count: 1 + path: ../../../Tests/Functional/Hooks/TranslateHookTest.php + + - + message: "#^Call to an undefined method TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration\\:\\:write\\(\\)\\.$#" + count: 2 + path: ../../../Tests/Functional/Regression/LocalizationInlineRegressionTest.php + + - + message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor invoked with 3 parameters, 7 required\\.$#" + count: 1 + path: ../../../Tests/Functional/Regression/LocalizationInlineRegressionTest.php + - message: "#^Method WebVision\\\\Deepltranslate\\\\Core\\\\Tests\\\\Functional\\\\Regression\\\\LocalizationInlineRegressionTest\\:\\:buildDefaultLanguageConfiguration\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -205,6 +240,21 @@ parameters: count: 1 path: ../../../Tests/Functional/Regression/LocalizationInlineRegressionTest.php + - + message: "#^Parameter \\#2 \\$siteSettingsFactory of class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor expects TYPO3\\\\CMS\\\\Core\\\\Site\\\\SiteSettingsFactory, Psr\\\\EventDispatcher\\\\EventDispatcherInterface given\\.$#" + count: 1 + path: ../../../Tests/Functional/Regression/LocalizationInlineRegressionTest.php + + - + message: "#^Call to an undefined method TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration\\:\\:write\\(\\)\\.$#" + count: 2 + path: ../../../Tests/Functional/Regression/PreviewTranslationInformationTest.php + + - + message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor invoked with 3 parameters, 7 required\\.$#" + count: 1 + path: ../../../Tests/Functional/Regression/PreviewTranslationInformationTest.php + - message: "#^Method WebVision\\\\Deepltranslate\\\\Core\\\\Tests\\\\Functional\\\\Regression\\\\PreviewTranslationInformationTest\\:\\:buildDefaultLanguageConfiguration\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -255,11 +305,26 @@ parameters: count: 1 path: ../../../Tests/Functional/Regression/PreviewTranslationInformationTest.php + - + message: "#^Parameter \\#2 \\$siteSettingsFactory of class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor expects TYPO3\\\\CMS\\\\Core\\\\Site\\\\SiteSettingsFactory, Psr\\\\EventDispatcher\\\\EventDispatcherInterface given\\.$#" + count: 1 + path: ../../../Tests/Functional/Regression/PreviewTranslationInformationTest.php + - message: "#^Cannot access property \\$code on DeepL\\\\Language\\|null\\.$#" count: 7 path: ../../../Tests/Functional/Services/DeeplServiceTest.php + - + message: "#^Call to an undefined method TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration\\:\\:write\\(\\)\\.$#" + count: 2 + path: ../../../Tests/Functional/Services/LanguageServiceTest.php + + - + message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor invoked with 3 parameters, 7 required\\.$#" + count: 1 + path: ../../../Tests/Functional/Services/LanguageServiceTest.php + - message: "#^Method WebVision\\\\Deepltranslate\\\\Core\\\\Tests\\\\Functional\\\\Services\\\\LanguageServiceTest\\:\\:buildDefaultLanguageConfiguration\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -310,6 +375,21 @@ parameters: count: 1 path: ../../../Tests/Functional/Services/LanguageServiceTest.php + - + message: "#^Parameter \\#2 \\$siteSettingsFactory of class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor expects TYPO3\\\\CMS\\\\Core\\\\Site\\\\SiteSettingsFactory, Psr\\\\EventDispatcher\\\\EventDispatcherInterface given\\.$#" + count: 1 + path: ../../../Tests/Functional/Services/LanguageServiceTest.php + + - + message: "#^Call to an undefined method TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration\\:\\:write\\(\\)\\.$#" + count: 2 + path: ../../../Tests/Functional/Updates/FormalityUpgradeWizardTest.php + + - + message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor invoked with 3 parameters, 7 required\\.$#" + count: 1 + path: ../../../Tests/Functional/Updates/FormalityUpgradeWizardTest.php + - message: "#^Method WebVision\\\\Deepltranslate\\\\Core\\\\Tests\\\\Functional\\\\Updates\\\\FormalityUpgradeWizardTest\\:\\:buildDefaultLanguageConfiguration\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -359,3 +439,13 @@ parameters: message: "#^Method WebVision\\\\Deepltranslate\\\\Core\\\\Tests\\\\Functional\\\\Updates\\\\FormalityUpgradeWizardTest\\:\\:writeSiteConfiguration\\(\\) has parameter \\$site with no value type specified in iterable type array\\.$#" count: 1 path: ../../../Tests/Functional/Updates/FormalityUpgradeWizardTest.php + + - + message: "#^Parameter \\#2 \\$siteSettingsFactory of class TYPO3\\\\CMS\\\\Core\\\\Configuration\\\\SiteConfiguration constructor expects TYPO3\\\\CMS\\\\Core\\\\Site\\\\SiteSettingsFactory, Psr\\\\EventDispatcher\\\\EventDispatcherInterface given\\.$#" + count: 1 + path: ../../../Tests/Functional/Updates/FormalityUpgradeWizardTest.php + + - + message: "#^Call to an undefined method TYPO3\\\\CMS\\\\Core\\\\View\\\\ViewInterface\\:\\:getRenderingContext\\(\\)\\.$#" + count: 3 + path: ../../../Tests/Functional/ViewHelpers/ExtensionActiveViewHelperTest.php diff --git a/Classes/Upgrades/FormalityUpgradeWizard.php b/Classes/Upgrades/FormalityUpgradeWizard.php index 32255675..ed737a13 100644 --- a/Classes/Upgrades/FormalityUpgradeWizard.php +++ b/Classes/Upgrades/FormalityUpgradeWizard.php @@ -10,7 +10,6 @@ use TYPO3\CMS\Core\Configuration\SiteConfiguration; use TYPO3\CMS\Core\Configuration\SiteWriter; use TYPO3\CMS\Core\Core\Environment; -use TYPO3\CMS\Core\Information\Typo3Version; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Install\Attribute\UpgradeWizard; use TYPO3\CMS\Install\Updates\ChattyInterface; @@ -50,9 +49,9 @@ public function updateNecessary(): bool public function executeUpdate(): bool { - $siteConfiguration = (((new Typo3Version())->getMajorVersion() < 13) - ? GeneralUtility::makeInstance(SiteConfiguration::class) - : GeneralUtility::makeInstance(SiteWriter::class)); + $siteConfiguration = (class_exists(SiteWriter::class)) + ? GeneralUtility::makeInstance(SiteWriter::class) + : GeneralUtility::makeInstance(SiteConfiguration::class); $deeplService = GeneralUtility::makeInstance(DeeplService::class); $globalFormality = 'default'; @@ -93,8 +92,11 @@ public function executeUpdate(): bool $explodedSiteConfigPath = explode(DIRECTORY_SEPARATOR, $file->getPath()); $siteIdentifier = array_pop($explodedSiteConfigPath); - - $siteConfiguration->write($siteIdentifier, $loadedSiteConfiguration); + if (method_exists($siteConfiguration, 'write')) { + $siteConfiguration->write($siteIdentifier, $loadedSiteConfiguration); + } else { + throw new \RuntimeException(__CLASS__ . ' does not implement write().', 1734624531); + } } return true;