Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Classes/Event/Listener/RenderWriteSelectEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
32 changes: 32 additions & 0 deletions Configuration/Services.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use TYPO3\CMS\Core\Information\Typo3Version;

return function (ContainerConfigurator $containerConfigurator, ContainerBuilder $containerBuilder) {
$typo3Version = new Typo3Version();
$majorVersion = $typo3Version->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),
);
//==================================================================================================================
};
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@
},
"autoload": {
"psr-4": {
"WebVision\\DeeplWrite\\": "Classes/"
"WebVision\\DeeplWrite\\": "Classes/",
"WebVision\\DeeplWrite\\Core13\\": "Core13/",
"WebVision\\DeeplWrite\\Core14\\": "Core14/"
}
},
"autoload-dev": {
Expand Down