diff --git a/Classes/Event/Listener/RenderWriteSelectEventListener.php b/Classes/Event/Listener/RenderWriteSelectEventListener.php index 84d3b6c..d9e31fc 100644 --- a/Classes/Event/Listener/RenderWriteSelectEventListener.php +++ b/Classes/Event/Listener/RenderWriteSelectEventListener.php @@ -9,6 +9,9 @@ use TYPO3\CMS\Core\Site\Entity\Site; use WebVision\DeeplWrite\Generator\WriteDropdownGenerator; +/** + * @todo Verify if this is still needed for TYPO3v14 and if not move at a later point. + */ final readonly class RenderWriteSelectEventListener { public function __construct( diff --git a/Configuration/Services.php b/Configuration/Services.php new file mode 100644 index 0000000..9330e08 --- /dev/null +++ b/Configuration/Services.php @@ -0,0 +1,32 @@ +getMajorVersion(); + $services = $containerConfigurator->services(); + + //================================================================================================================== + // The default configuration: allow autowire and autoconfigure, + // no need to make every class public. + //================================================================================================================== + $services->defaults() + ->autowire() + ->autoconfigure() + ->private(); // "private" is the default and can safely be omitted + //================================================================================================================== + + //================================================================================================================== + // Define the location of the PHP sources of our extension. + // In addition, exclude Extbase models that should never be used via DI. + //================================================================================================================== + $services->load( + sprintf('WebVision\\DeeplWrite\\Core%s\\', $majorVersion), + sprintf(__DIR__ . '/../Core%s/', $majorVersion), + ); + //================================================================================================================== +}; diff --git a/Classes/Event/Listener/ApplyLocalizationModesEventListener.php b/Core13/Event/Listener/ApplyLocalizationModesEventListener.php similarity index 93% rename from Classes/Event/Listener/ApplyLocalizationModesEventListener.php rename to Core13/Event/Listener/ApplyLocalizationModesEventListener.php index 1cb03f4..02ce7a4 100644 --- a/Classes/Event/Listener/ApplyLocalizationModesEventListener.php +++ b/Core13/Event/Listener/ApplyLocalizationModesEventListener.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace WebVision\DeeplWrite\Event\Listener; +namespace WebVision\DeeplWrite\Core13\Event\Listener; use TYPO3\CMS\Core\Attribute\AsEventListener; use TYPO3\CMS\Core\Information\Typo3Version; @@ -14,7 +14,7 @@ * event {@see GetLocalizationModesEvent} dispatched by extension `deepl_base` * in {@see LocalizationController::dispatchGetLocalizationModesEvent()}. * - * @todo Move to `Core13/` only code execution. + * @internal and not part of public API. */ final class ApplyLocalizationModesEventListener { diff --git a/Classes/Event/Listener/DeeplWritePageViewRegistrationEventListener.php b/Core13/Event/Listener/DeeplWritePageViewRegistrationEventListener.php similarity index 97% rename from Classes/Event/Listener/DeeplWritePageViewRegistrationEventListener.php rename to Core13/Event/Listener/DeeplWritePageViewRegistrationEventListener.php index b687e32..4be64f3 100644 --- a/Classes/Event/Listener/DeeplWritePageViewRegistrationEventListener.php +++ b/Core13/Event/Listener/DeeplWritePageViewRegistrationEventListener.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace WebVision\DeeplWrite\Event\Listener; +namespace WebVision\DeeplWrite\Core13\Event\Listener; use TYPO3\CMS\Backend\Routing\Exception\RouteNotFoundException; use TYPO3\CMS\Backend\Routing\UriBuilder; @@ -15,6 +15,8 @@ /** * This EventListener registers the partial and the dropdown options * for the translation/write optimization dropdown in PageView + * + * @internal and not part of public API. */ final class DeeplWritePageViewRegistrationEventListener { diff --git a/Classes/Event/Listener/ProcessLocalizationModeEventListener.php b/Core13/Event/Listener/ProcessLocalizationModeEventListener.php similarity index 92% rename from Classes/Event/Listener/ProcessLocalizationModeEventListener.php rename to Core13/Event/Listener/ProcessLocalizationModeEventListener.php index 75446b3..9df7614 100644 --- a/Classes/Event/Listener/ProcessLocalizationModeEventListener.php +++ b/Core13/Event/Listener/ProcessLocalizationModeEventListener.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace WebVision\DeeplWrite\Event\Listener; +namespace WebVision\DeeplWrite\Core13\Event\Listener; use TYPO3\CMS\Core\Attribute\AsEventListener; use WebVision\Deepl\Base\Event\LocalizationProcessPrepareDataHandlerCommandMapEvent; /** - * @todo Move to `Core13/` only code execution. + * @internal and not part of public API. */ final class ProcessLocalizationModeEventListener { diff --git a/composer.json b/composer.json index d23b6d6..e9b38fe 100644 --- a/composer.json +++ b/composer.json @@ -53,7 +53,9 @@ }, "autoload": { "psr-4": { - "WebVision\\DeeplWrite\\": "Classes/" + "WebVision\\DeeplWrite\\": "Classes/", + "WebVision\\DeeplWrite\\Core13\\": "Core13/", + "WebVision\\DeeplWrite\\Core14\\": "Core14/" } }, "autoload-dev": {