Skip to content

Commit c24fede

Browse files
lchruscieldiimpp
andauthored
refactor #860 Move translations' namespace (loic425)
This PR was merged into the 1.11 branch. Discussion ---------- | Q | A | --------------- | ----- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Related tickets | | License | MIT Based on #859 Commits ------- 568a8e4 Move resource actions fb42ee4 Move translations' namespace 8e6a662 Add bc-layer bbcdaea Move spec files c1a12d3 Test aliases ef93451 Fix TranslatableEntityLocaleAssignerInterface cf1124d Apply suggestions from code review Co-authored-by: Dmitri Perunov <[email protected]> 16585e7 Fix coding standard
2 parents 1938ab8 + 16585e7 commit c24fede

32 files changed

+264
-86
lines changed

phpstan.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ parameters:
3232
- %currentWorkingDirectory%/src/Component/legacy/src/Reflection/ClassReflection.php
3333
- %currentWorkingDirectory%/src/Component/legacy/src/Repository/*
3434
- %currentWorkingDirectory%/src/Component/legacy/src/Storage/*
35+
- %currentWorkingDirectory%/src/Component/legacy/src/Translation/*
3536
- %currentWorkingDirectory%/src/Component/legacy/tests/*
3637
- %currentWorkingDirectory%/src/Component/spec/*
3738
- %currentWorkingDirectory%/src/Component/tests/*

psalm.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@
231231
<directory name="src/Component/legacy/src/Reflection" />
232232
<directory name="src/Component/legacy/src/Repository" />
233233
<directory name="src/Component/legacy/src/Storage" />
234+
<directory name="src/Component/legacy/src/Translation" />
234235
<file name="src/Bundle/Event/ResourceControllerEvent.php" />
235236
<file name="src/Component/src/Symfony/Request/State/TwigResponder.php" />
236237
</errorLevel>
@@ -269,6 +270,7 @@
269270
<directory name="src/Component/legacy/src/Model" />
270271
<directory name="src/Component/legacy/src/Repository" />
271272
<directory name="src/Component/legacy/src/Storage" />
273+
<directory name="src/Component/legacy/src/Translation" />
272274
</errorLevel>
273275
</UnrecognizedStatement>
274276

src/Bundle/Controller/RedirectHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
namespace Sylius\Bundle\ResourceBundle\Controller;
1515

16-
use Sylius\Component\Resource\ResourceActions;
1716
use Sylius\Resource\Model\ResourceInterface;
17+
use Sylius\Resource\ResourceActions;
1818
use Symfony\Component\HttpFoundation\RedirectResponse;
1919
use Symfony\Component\HttpFoundation\Response;
2020
use Symfony\Component\Routing\Exception\RouteNotFoundException;

src/Bundle/Controller/ResourceController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
use Sylius\Bundle\ResourceBundle\Event\ResourceControllerEvent;
1919
use Sylius\Component\Resource\Exception\DeleteHandlingException;
2020
use Sylius\Component\Resource\Exception\UpdateHandlingException;
21-
use Sylius\Component\Resource\ResourceActions;
2221
use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
2322
use Sylius\Resource\Factory\FactoryInterface;
2423
use Sylius\Resource\Metadata\MetadataInterface;
2524
use Sylius\Resource\Model\ResourceInterface;
25+
use Sylius\Resource\ResourceActions;
2626
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
2727
use Symfony\Component\DependencyInjection\ContainerInterface;
2828
use Symfony\Component\HttpFoundation\Request;

src/Bundle/EventListener/ORMTranslatableListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
use Doctrine\ORM\Events;
2020
use Doctrine\ORM\Mapping\ClassMetadata;
2121
use Doctrine\ORM\Mapping\ClassMetadataInfo;
22-
use Sylius\Component\Resource\Translation\TranslatableEntityLocaleAssignerInterface;
2322
use Sylius\Resource\Metadata\MetadataInterface;
2423
use Sylius\Resource\Metadata\RegistryInterface;
2524
use Sylius\Resource\Model\TranslatableInterface;
2625
use Sylius\Resource\Model\TranslationInterface;
26+
use Sylius\Resource\Translation\TranslatableEntityLocaleAssignerInterface;
2727
use Symfony\Component\DependencyInjection\ContainerInterface;
2828

2929
final class ORMTranslatableListener implements EventSubscriber

src/Bundle/Form/Type/ResourceTranslationsType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313

1414
namespace Sylius\Bundle\ResourceBundle\Form\Type;
1515

16-
use Sylius\Component\Resource\Translation\Provider\TranslationLocaleProviderInterface;
1716
use Sylius\Resource\Model\TranslatableInterface;
1817
use Sylius\Resource\Model\TranslationInterface;
18+
use Sylius\Resource\Translation\Provider\TranslationLocaleProviderInterface;
1919
use Symfony\Component\Form\AbstractType;
2020
use Symfony\Component\Form\FormBuilderInterface;
2121
use Symfony\Component\Form\FormEvent;

src/Bundle/Resources/config/services/integrations/translation.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,17 @@
1515
<services>
1616
<defaults public="true" />
1717

18-
<service id="sylius.translation_locale_provider.immutable" class="Sylius\Component\Resource\Translation\Provider\ImmutableTranslationLocaleProvider">
18+
<service id="sylius.translation_locale_provider.immutable" class="Sylius\Resource\Translation\Provider\ImmutableTranslationLocaleProvider">
1919
<argument type="collection">
2020
<argument>%locale%</argument>
2121
</argument>
2222
<argument>%locale%</argument>
2323
</service>
24-
<service id="Sylius\Component\Resource\Translation\Provider\ImmutableTranslationLocaleProvider" alias="sylius.translation_locale_provider.immutable" />
24+
<service id="Sylius\Component\Resource\Translation\Provider\ImmutableTranslationLocaleProvider" alias="sylius.translation_locale_provider.immutable">
25+
<deprecated package="sylius/resource-bundle" version="1.11">The "%alias_id%" service alias is deprecated since sylius/resource-bundle 1.11 and will be removed in sylius/resource-bundle 2.0. Use Sylius\Resource\Translation\Provider\ImmutableTranslationLocaleProvider instead.</deprecated>
26+
</service>
27+
<service id="Sylius\Resource\Translation\Provider\ImmutableTranslationLocaleProvider" alias="sylius.translation_locale_provider.immutable" />
28+
<service id="Sylius\Resource\Translation\Provider\TranslationLocaleProviderInterface" alias="sylius.translation_locale_provider.immutable" />
2529

2630
<service id="sylius.translation.translatable_listener.doctrine.orm" class="Sylius\Bundle\ResourceBundle\EventListener\ORMTranslatableListener">
2731
<argument type="service" id="sylius.resource_registry" />

src/Bundle/spec/Controller/EventDispatcherSpec.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
use Sylius\Bundle\ResourceBundle\Controller\EventDispatcherInterface as ControllerEventDispatcherInterface;
2020
use Sylius\Bundle\ResourceBundle\Controller\RequestConfiguration;
2121
use Sylius\Bundle\ResourceBundle\Event\ResourceControllerEvent;
22-
use Sylius\Component\Resource\ResourceActions;
2322
use Sylius\Resource\Metadata\MetadataInterface;
2423
use Sylius\Resource\Model\ResourceInterface;
24+
use Sylius\Resource\ResourceActions;
2525
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
2626

2727
final class EventDispatcherSpec extends ObjectBehavior

src/Bundle/spec/Controller/FlashHelperSpec.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
use Sylius\Bundle\ResourceBundle\Controller\FlashHelperInterface;
1818
use Sylius\Bundle\ResourceBundle\Controller\RequestConfiguration;
1919
use Sylius\Bundle\ResourceBundle\Event\ResourceControllerEvent;
20-
use Sylius\Component\Resource\ResourceActions;
2120
use Sylius\Resource\Metadata\MetadataInterface;
2221
use Sylius\Resource\Model\ResourceInterface;
22+
use Sylius\Resource\ResourceActions;
2323
use Symfony\Component\HttpFoundation\RequestStack;
2424
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface;
2525
use Symfony\Component\HttpFoundation\Session\SessionInterface;

src/Bundle/spec/Controller/ResourceControllerSpec.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@
3434
use Sylius\Bundle\ResourceBundle\Controller\ViewHandlerInterface;
3535
use Sylius\Bundle\ResourceBundle\Event\ResourceControllerEvent;
3636
use Sylius\Component\Resource\Exception\DeleteHandlingException;
37-
use Sylius\Component\Resource\ResourceActions;
3837
use Sylius\Resource\Doctrine\Persistence\RepositoryInterface;
3938
use Sylius\Resource\Factory\FactoryInterface;
4039
use Sylius\Resource\Metadata\MetadataInterface;
4140
use Sylius\Resource\Model\ResourceInterface;
41+
use Sylius\Resource\ResourceActions;
4242
use Symfony\Component\DependencyInjection\ContainerInterface;
4343
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
4444
use Symfony\Component\Form\Form;

0 commit comments

Comments
 (0)