diff --git a/docs/resource_factories.md b/docs/resource_factories.md index 586f618cd..b86f0c10a 100644 --- a/docs/resource_factories.md +++ b/docs/resource_factories.md @@ -28,7 +28,7 @@ declare(strict_types=1); namespace App\Factory; use App\Entity\Book; -use Sylius\Component\Resource\Factory\FactoryInterface; +use Sylius\Resource\Factory\FactoryInterface; final class BookFactory implements FactoryInterface { @@ -61,9 +61,8 @@ declare(strict_types=1); namespace App\Factory; use App\Entity\Book; +use Sylius\Resource\Factory\FactoryInterface; use Symfony\Component\Security\Core\Security; -use Sylius\Component\Resource\Factory\FactoryInterface; -use Sylius\Component\Resource\Repository\RepositoryInterface; final class BookFactory implements FactoryInterface { @@ -130,8 +129,8 @@ declare(strict_types=1); namespace App\Factory; use App\Entity\Book; -use Sylius\Component\Resource\Factory\FactoryInterface; use Sylius\Component\Resource\Repository\RepositoryInterface; +use Sylius\Resource\Factory\FactoryInterface; final class BookFactory implements FactoryInterface { diff --git a/phpstan.neon b/phpstan.neon index 1ef4133c0..785e92428 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -24,6 +24,7 @@ parameters: - %currentWorkingDirectory%/src/Bundle/spec/* - %currentWorkingDirectory%/src/Bundle/Tests/* - %currentWorkingDirectory%/src/Component/Annotation/* + - %currentWorkingDirectory%/src/Component/Factory/* - %currentWorkingDirectory%/src/Component/Reflection/ClassReflection.php - %currentWorkingDirectory%/src/Component/spec/* - %currentWorkingDirectory%/src/Component/Storage/* diff --git a/psalm.xml b/psalm.xml index e11af6ffe..776bb0254 100644 --- a/psalm.xml +++ b/psalm.xml @@ -185,6 +185,7 @@ + @@ -209,6 +210,7 @@ + diff --git a/src/Bundle/Controller/NewResourceFactory.php b/src/Bundle/Controller/NewResourceFactory.php index 13b7dd1dc..19031bef5 100644 --- a/src/Bundle/Controller/NewResourceFactory.php +++ b/src/Bundle/Controller/NewResourceFactory.php @@ -13,8 +13,8 @@ namespace Sylius\Bundle\ResourceBundle\Controller; -use Sylius\Component\Resource\Factory\FactoryInterface; use Sylius\Component\Resource\Model\ResourceInterface; +use Sylius\Resource\Factory\FactoryInterface; final class NewResourceFactory implements NewResourceFactoryInterface { diff --git a/src/Bundle/Controller/NewResourceFactoryInterface.php b/src/Bundle/Controller/NewResourceFactoryInterface.php index c41907608..29925024f 100644 --- a/src/Bundle/Controller/NewResourceFactoryInterface.php +++ b/src/Bundle/Controller/NewResourceFactoryInterface.php @@ -13,8 +13,8 @@ namespace Sylius\Bundle\ResourceBundle\Controller; -use Sylius\Component\Resource\Factory\FactoryInterface; use Sylius\Component\Resource\Model\ResourceInterface; +use Sylius\Resource\Factory\FactoryInterface; interface NewResourceFactoryInterface { diff --git a/src/Bundle/Controller/ResourceController.php b/src/Bundle/Controller/ResourceController.php index 6e1b10901..75b55594a 100644 --- a/src/Bundle/Controller/ResourceController.php +++ b/src/Bundle/Controller/ResourceController.php @@ -18,11 +18,11 @@ use Sylius\Bundle\ResourceBundle\Event\ResourceControllerEvent; use Sylius\Component\Resource\Exception\DeleteHandlingException; use Sylius\Component\Resource\Exception\UpdateHandlingException; -use Sylius\Component\Resource\Factory\FactoryInterface; use Sylius\Component\Resource\Metadata\MetadataInterface; use Sylius\Component\Resource\Model\ResourceInterface; use Sylius\Component\Resource\Repository\RepositoryInterface; use Sylius\Component\Resource\ResourceActions; +use Sylius\Resource\Factory\FactoryInterface; use Symfony\Component\DependencyInjection\ContainerAwareTrait; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; diff --git a/src/Bundle/DependencyInjection/Configuration.php b/src/Bundle/DependencyInjection/Configuration.php index 2867b9f0f..b963cfb5e 100644 --- a/src/Bundle/DependencyInjection/Configuration.php +++ b/src/Bundle/DependencyInjection/Configuration.php @@ -16,7 +16,7 @@ use Sylius\Bundle\ResourceBundle\Controller\ResourceController; use Sylius\Bundle\ResourceBundle\Form\Type\DefaultResourceType; use Sylius\Bundle\ResourceBundle\SyliusResourceBundle; -use Sylius\Component\Resource\Factory\Factory; +use Sylius\Resource\Factory\Factory; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; diff --git a/src/Bundle/DependencyInjection/Driver/AbstractDriver.php b/src/Bundle/DependencyInjection/Driver/AbstractDriver.php index d5fdc21df..3b9e0f7ac 100644 --- a/src/Bundle/DependencyInjection/Driver/AbstractDriver.php +++ b/src/Bundle/DependencyInjection/Driver/AbstractDriver.php @@ -13,10 +13,10 @@ namespace Sylius\Bundle\ResourceBundle\DependencyInjection\Driver; -use Sylius\Component\Resource\Factory\Factory; -use Sylius\Component\Resource\Factory\TranslatableFactoryInterface; use Sylius\Component\Resource\Metadata\Metadata; use Sylius\Component\Resource\Metadata\MetadataInterface; +use Sylius\Resource\Factory\Factory; +use Sylius\Resource\Factory\TranslatableFactoryInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Definition; diff --git a/src/Bundle/DependencyInjection/SyliusResourceExtension.php b/src/Bundle/DependencyInjection/SyliusResourceExtension.php index a6e492f03..a6ba45be7 100644 --- a/src/Bundle/DependencyInjection/SyliusResourceExtension.php +++ b/src/Bundle/DependencyInjection/SyliusResourceExtension.php @@ -20,10 +20,11 @@ use Sylius\Bundle\ResourceBundle\DependencyInjection\Driver\DriverProvider; use Sylius\Bundle\ResourceBundle\Form\Type\DefaultResourceType; use Sylius\Bundle\ResourceBundle\SyliusResourceBundle; -use Sylius\Component\Resource\Factory\Factory; -use Sylius\Component\Resource\Factory\FactoryInterface; +use Sylius\Component\Resource\Factory\FactoryInterface as LegacyFactoryInterface; use Sylius\Component\Resource\Metadata\Metadata; use Sylius\Component\Resource\Reflection\ClassReflection; +use Sylius\Resource\Factory\Factory; +use Sylius\Resource\Factory\FactoryInterface; use Sylius\Resource\Metadata\AsResource; use Sylius\Resource\Metadata\ResourceMetadata; use Sylius\Resource\State\ProcessorInterface; @@ -86,6 +87,10 @@ public function load(array $configs, ContainerBuilder $container): void ->addTag('sylius.resource_factory') ; + $container->registerForAutoconfiguration(LegacyFactoryInterface::class) + ->addTag('sylius.resource_factory') + ; + $container->registerForAutoconfiguration(ContextFactoryInterface::class) ->addTag('sylius.twig_context_factory') ; diff --git a/src/Bundle/spec/Controller/NewResourceFactorySpec.php b/src/Bundle/spec/Controller/NewResourceFactorySpec.php index 51596fbb4..d76d899d9 100644 --- a/src/Bundle/spec/Controller/NewResourceFactorySpec.php +++ b/src/Bundle/spec/Controller/NewResourceFactorySpec.php @@ -16,8 +16,8 @@ use PhpSpec\ObjectBehavior; use Sylius\Bundle\ResourceBundle\Controller\NewResourceFactoryInterface; use Sylius\Bundle\ResourceBundle\Controller\RequestConfiguration; -use Sylius\Component\Resource\Factory\FactoryInterface; use Sylius\Component\Resource\Model\ResourceInterface; +use Sylius\Resource\Factory\FactoryInterface; final class NewResourceFactorySpec extends ObjectBehavior { diff --git a/src/Bundle/spec/Controller/ResourceControllerSpec.php b/src/Bundle/spec/Controller/ResourceControllerSpec.php index 1f839a81d..ce6ea4c6e 100644 --- a/src/Bundle/spec/Controller/ResourceControllerSpec.php +++ b/src/Bundle/spec/Controller/ResourceControllerSpec.php @@ -34,11 +34,11 @@ use Sylius\Bundle\ResourceBundle\Controller\ViewHandlerInterface; use Sylius\Bundle\ResourceBundle\Event\ResourceControllerEvent; use Sylius\Component\Resource\Exception\DeleteHandlingException; -use Sylius\Component\Resource\Factory\FactoryInterface; use Sylius\Component\Resource\Metadata\MetadataInterface; use Sylius\Component\Resource\Model\ResourceInterface; use Sylius\Component\Resource\Repository\RepositoryInterface; use Sylius\Component\Resource\ResourceActions; +use Sylius\Resource\Factory\FactoryInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; use Symfony\Component\Form\Form; diff --git a/src/Component/Factory/Factory.php b/src/Component/Factory/Factory.php index 1af9e8f51..834fd28fe 100644 --- a/src/Component/Factory/Factory.php +++ b/src/Component/Factory/Factory.php @@ -13,27 +13,13 @@ namespace Sylius\Component\Resource\Factory; -/** - * Creates resources based on theirs FQCN. - */ -final class Factory implements FactoryInterface -{ - /** - * @var string - * @psalm-var class-string - */ - private $className; +class_exists(\Sylius\Resource\Factory\Factory::class); +if (false) { /** - * @psalm-param class-string $className + * @inheritDoc */ - public function __construct(string $className) - { - $this->className = $className; - } - - public function createNew() + final class Factory extends \Sylius\Resource\Factory\Factory { - return new $this->className(); } } diff --git a/src/Component/Factory/FactoryInterface.php b/src/Component/Factory/FactoryInterface.php index ccfca4266..c22966cf3 100644 --- a/src/Component/Factory/FactoryInterface.php +++ b/src/Component/Factory/FactoryInterface.php @@ -13,13 +13,13 @@ namespace Sylius\Component\Resource\Factory; -/** - * @template T of object - */ -interface FactoryInterface -{ +interface_exists(\Sylius\Resource\Factory\FactoryInterface::class); + +if (false) { /** - * @return T + * @inheritDoc */ - public function createNew(); + interface FactoryInterface extends \Sylius\Resource\Factory\FactoryInterface + { + } } diff --git a/src/Component/Factory/TranslatableFactory.php b/src/Component/Factory/TranslatableFactory.php index 23a214253..aa642fc75 100644 --- a/src/Component/Factory/TranslatableFactory.php +++ b/src/Component/Factory/TranslatableFactory.php @@ -13,36 +13,10 @@ namespace Sylius\Component\Resource\Factory; -use Sylius\Component\Resource\Exception\UnexpectedTypeException; -use Sylius\Component\Resource\Model\TranslatableInterface; -use Sylius\Component\Resource\Translation\Provider\TranslationLocaleProviderInterface; +class_exists(\Sylius\Resource\Factory\TranslatableFactory::class); -final class TranslatableFactory implements TranslatableFactoryInterface -{ - private FactoryInterface $factory; - - private TranslationLocaleProviderInterface $localeProvider; - - public function __construct(FactoryInterface $factory, TranslationLocaleProviderInterface $localeProvider) - { - $this->factory = $factory; - $this->localeProvider = $localeProvider; - } - - /** - * @throws UnexpectedTypeException - */ - public function createNew() +if (false) { + final class TranslatableFactory extends \Sylius\Resource\Factory\TranslatableFactory { - $resource = $this->factory->createNew(); - - if (!$resource instanceof TranslatableInterface) { - throw new UnexpectedTypeException($resource, TranslatableInterface::class); - } - - $resource->setCurrentLocale($this->localeProvider->getDefaultLocaleCode()); - $resource->setFallbackLocale($this->localeProvider->getDefaultLocaleCode()); - - return $resource; } } diff --git a/src/Component/Factory/TranslatableFactoryInterface.php b/src/Component/Factory/TranslatableFactoryInterface.php index 6e671fdc5..30ea09c9d 100644 --- a/src/Component/Factory/TranslatableFactoryInterface.php +++ b/src/Component/Factory/TranslatableFactoryInterface.php @@ -13,13 +13,17 @@ namespace Sylius\Component\Resource\Factory; -/** - * @template T of object - */ -interface TranslatableFactoryInterface extends FactoryInterface -{ +interface_exists(\Sylius\Resource\Factory\TranslatableFactoryInterface::class); + +if (false) { /** - * @return T + * @inheritDoc */ - public function createNew(); + interface TranslatableFactoryInterface extends \Sylius\Resource\Factory\TranslatableFactoryInterface + { + /** + * @inheritDoc + */ + public function createNew(); + } } diff --git a/src/Component/spec/Factory/FactorySpec.php b/src/Component/spec/Factory/FactorySpec.php index 2342620e3..319fa55b5 100644 --- a/src/Component/spec/Factory/FactorySpec.php +++ b/src/Component/spec/Factory/FactorySpec.php @@ -14,7 +14,9 @@ namespace spec\Sylius\Component\Resource\Factory; use PhpSpec\ObjectBehavior; -use Sylius\Component\Resource\Factory\FactoryInterface; +use Sylius\Component\Resource\Factory\FactoryInterface as LegacyFactoryInterface; +use Sylius\Resource\Factory\Factory as NewFactory; +use Sylius\Resource\Factory\FactoryInterface; final class FactorySpec extends ObjectBehavior { @@ -28,6 +30,16 @@ function it_implements_factory_interface(): void $this->shouldHaveType(FactoryInterface::class); } + function it_implements_legacy_factory_interface(): void + { + $this->shouldHaveType(LegacyFactoryInterface::class); + } + + function it_is_an_alias_of_the_factory(): void + { + $this->shouldBeAnInstanceOf(NewFactory::class); + } + function it_creates_a_new_instance_of_a_resource(): void { $this->createNew()->shouldHaveType(\stdClass::class); diff --git a/src/Component/spec/Factory/TranslatableFactorySpec.php b/src/Component/spec/Factory/TranslatableFactorySpec.php index 8c6c7b5ac..034a5eb16 100644 --- a/src/Component/spec/Factory/TranslatableFactorySpec.php +++ b/src/Component/spec/Factory/TranslatableFactorySpec.php @@ -14,11 +14,11 @@ namespace spec\Sylius\Component\Resource\Factory; use PhpSpec\ObjectBehavior; -use Sylius\Component\Resource\Exception\UnexpectedTypeException; -use Sylius\Component\Resource\Factory\FactoryInterface; -use Sylius\Component\Resource\Factory\TranslatableFactoryInterface; -use Sylius\Component\Resource\Model\TranslatableInterface; +use Sylius\Component\Resource\Factory\TranslatableFactoryInterface as LegacyTranslatableFactoryInterface; use Sylius\Component\Resource\Translation\Provider\TranslationLocaleProviderInterface; +use Sylius\Resource\Factory\FactoryInterface; +use Sylius\Resource\Factory\TranslatableFactory as NewTranslatableFactory; +use Sylius\Resource\Factory\TranslatableFactoryInterface; final class TranslatableFactorySpec extends ObjectBehavior { @@ -32,28 +32,13 @@ function it_implements_translatable_factory_interface(): void $this->shouldImplement(TranslatableFactoryInterface::class); } - function it_throws_an_exception_if_resource_is_not_translatable(FactoryInterface $factory, \stdClass $resource): void + function it_implements_legacy_translatable_factory_interface(): void { - $factory->createNew()->willReturn($resource); - - $this - ->shouldThrow(UnexpectedTypeException::class) - ->during('createNew') - ; + $this->shouldImplement(LegacyTranslatableFactoryInterface::class); } - function it_creates_translatable_and_sets_locales( - FactoryInterface $factory, - TranslationLocaleProviderInterface $localeProvider, - TranslatableInterface $resource, - ): void { - $localeProvider->getDefaultLocaleCode()->willReturn('pl_PL'); - - $factory->createNew()->willReturn($resource); - - $resource->setCurrentLocale('pl_PL')->shouldBeCalled(); - $resource->setFallbackLocale('pl_PL')->shouldBeCalled(); - - $this->createNew()->shouldReturn($resource); + function it_should_be_an_alias_of_translatable_factory_interface(): void + { + $this->shouldBeAnInstanceOf(NewTranslatableFactory::class); } } diff --git a/src/Component/src/Factory/Factory.php b/src/Component/src/Factory/Factory.php new file mode 100644 index 000000000..9d28f0676 --- /dev/null +++ b/src/Component/src/Factory/Factory.php @@ -0,0 +1,38 @@ +className = $className; + } + + public function createNew() + { + return new $this->className(); + } +} + +class_alias(Factory::class, \Sylius\Component\Resource\Factory\Factory::class); diff --git a/src/Component/src/Factory/FactoryInterface.php b/src/Component/src/Factory/FactoryInterface.php new file mode 100644 index 000000000..69d704bcd --- /dev/null +++ b/src/Component/src/Factory/FactoryInterface.php @@ -0,0 +1,27 @@ +factory = $factory; + $this->localeProvider = $localeProvider; + } + + /** + * @throws UnexpectedTypeException + */ + public function createNew() + { + $resource = $this->factory->createNew(); + + if (!$resource instanceof TranslatableInterface) { + throw new UnexpectedTypeException($resource, TranslatableInterface::class); + } + + $resource->setCurrentLocale($this->localeProvider->getDefaultLocaleCode()); + $resource->setFallbackLocale($this->localeProvider->getDefaultLocaleCode()); + + return $resource; + } +} + +class_alias(TranslatableFactory::class, \Sylius\Component\Resource\Factory\TranslatableFactory::class); diff --git a/src/Component/src/Factory/TranslatableFactoryInterface.php b/src/Component/src/Factory/TranslatableFactoryInterface.php new file mode 100644 index 000000000..1f7f4cbfc --- /dev/null +++ b/src/Component/src/Factory/TranslatableFactoryInterface.php @@ -0,0 +1,27 @@ +beConstructedWith(\stdClass::class); + } + + function it_implements_factory_interface(): void + { + $this->shouldHaveType(FactoryInterface::class); + } + + function it_creates_a_new_instance_of_a_resource(): void + { + $this->createNew()->shouldHaveType(\stdClass::class); + } +} diff --git a/src/Component/tests/spec/Factory/TranslatableFactorySpec.php b/src/Component/tests/spec/Factory/TranslatableFactorySpec.php new file mode 100644 index 000000000..867e7d2a7 --- /dev/null +++ b/src/Component/tests/spec/Factory/TranslatableFactorySpec.php @@ -0,0 +1,59 @@ +beConstructedWith($factory, $localeProvider); + } + + function it_implements_translatable_factory_interface(): void + { + $this->shouldImplement(TranslatableFactoryInterface::class); + } + + function it_throws_an_exception_if_resource_is_not_translatable(FactoryInterface $factory, \stdClass $resource): void + { + $factory->createNew()->willReturn($resource); + + $this + ->shouldThrow(UnexpectedTypeException::class) + ->during('createNew') + ; + } + + function it_creates_translatable_and_sets_locales( + FactoryInterface $factory, + TranslationLocaleProviderInterface $localeProvider, + TranslatableInterface $resource, + ): void { + $localeProvider->getDefaultLocaleCode()->willReturn('pl_PL'); + + $factory->createNew()->willReturn($resource); + + $resource->setCurrentLocale('pl_PL')->shouldBeCalled(); + $resource->setFallbackLocale('pl_PL')->shouldBeCalled(); + + $this->createNew()->shouldReturn($resource); + } +} diff --git a/src/Component/tests/spec/State/FactorySpec.php b/src/Component/tests/spec/State/FactorySpec.php index cdc9fdcad..bae0106e3 100644 --- a/src/Component/tests/spec/State/FactorySpec.php +++ b/src/Component/tests/spec/State/FactorySpec.php @@ -15,8 +15,8 @@ use PhpSpec\ObjectBehavior; use Psr\Container\ContainerInterface; -use Sylius\Component\Resource\Factory\FactoryInterface; use Sylius\Resource\Context\Context; +use Sylius\Resource\Factory\FactoryInterface; use Sylius\Resource\Metadata\Create; use Sylius\Resource\State\Factory; use Sylius\Resource\Symfony\ExpressionLanguage\ArgumentParserInterface; diff --git a/tests/Application/src/Factory/BookFactory.php b/tests/Application/src/Factory/BookFactory.php index df15348cd..356d4e738 100644 --- a/tests/Application/src/Factory/BookFactory.php +++ b/tests/Application/src/Factory/BookFactory.php @@ -14,9 +14,9 @@ namespace App\Factory; use Sylius\Component\Resource\Exception\UnexpectedTypeException; -use Sylius\Component\Resource\Factory\FactoryInterface; use Sylius\Component\Resource\Model\TranslatableInterface; use Sylius\Component\Resource\Translation\Provider\TranslationLocaleProviderInterface; +use Sylius\Resource\Factory\FactoryInterface; final class BookFactory implements BookFactoryInterface { diff --git a/tests/Application/src/Factory/BookFactoryInterface.php b/tests/Application/src/Factory/BookFactoryInterface.php index 970bf75d8..10ca33c2f 100644 --- a/tests/Application/src/Factory/BookFactoryInterface.php +++ b/tests/Application/src/Factory/BookFactoryInterface.php @@ -13,7 +13,7 @@ namespace App\Factory; -use Sylius\Component\Resource\Factory\TranslatableFactoryInterface; +use Sylius\Resource\Factory\TranslatableFactoryInterface; interface BookFactoryInterface extends TranslatableFactoryInterface { diff --git a/tests/Application/src/Service/FirstAutowiredService.php b/tests/Application/src/Service/FirstAutowiredService.php index 0702ec7a3..b7f950be6 100644 --- a/tests/Application/src/Service/FirstAutowiredService.php +++ b/tests/Application/src/Service/FirstAutowiredService.php @@ -14,8 +14,8 @@ namespace App\Service; use Doctrine\Persistence\ObjectManager; -use Sylius\Component\Resource\Factory\FactoryInterface; use Sylius\Component\Resource\Repository\RepositoryInterface; +use Sylius\Resource\Factory\FactoryInterface; final class FirstAutowiredService { diff --git a/tests/Application/src/Service/NoInterfaceAutowiredService.php b/tests/Application/src/Service/NoInterfaceAutowiredService.php index a61a97a67..68e5637a0 100644 --- a/tests/Application/src/Service/NoInterfaceAutowiredService.php +++ b/tests/Application/src/Service/NoInterfaceAutowiredService.php @@ -16,7 +16,7 @@ use App\Factory\BookFactory; use App\Repository\BookRepository; use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository; -use Sylius\Component\Resource\Factory\Factory; +use Sylius\Resource\Factory\Factory; final class NoInterfaceAutowiredService { diff --git a/tests/Application/src/Subscription/Factory/SubscriptionFactory.php b/tests/Application/src/Subscription/Factory/SubscriptionFactory.php index 59425b40c..01c35ffb1 100644 --- a/tests/Application/src/Subscription/Factory/SubscriptionFactory.php +++ b/tests/Application/src/Subscription/Factory/SubscriptionFactory.php @@ -14,7 +14,7 @@ namespace App\Subscription\Factory; use App\Subscription\Entity\Subscription; -use Sylius\Component\Resource\Factory\FactoryInterface; +use Sylius\Resource\Factory\FactoryInterface; final class SubscriptionFactory implements FactoryInterface { diff --git a/tests/Bundle/DependencyInjection/SyliusResourceExtensionTest.php b/tests/Bundle/DependencyInjection/SyliusResourceExtensionTest.php index 78f7c4902..782a4f401 100644 --- a/tests/Bundle/DependencyInjection/SyliusResourceExtensionTest.php +++ b/tests/Bundle/DependencyInjection/SyliusResourceExtensionTest.php @@ -24,7 +24,7 @@ use Sylius\Bundle\ResourceBundle\Tests\DependencyInjection\Dummy\BookWithAliasResource; use Sylius\Bundle\ResourceBundle\Tests\DependencyInjection\Dummy\DummyResource; use Sylius\Bundle\ResourceBundle\Tests\DependencyInjection\Dummy\NoDriverResource; -use Sylius\Component\Resource\Factory\Factory; +use Sylius\Resource\Factory\Factory; class SyliusResourceExtensionTest extends AbstractExtensionTestCase { diff --git a/tests/Bundle/Resource/ResourceServicesTest.php b/tests/Bundle/Resource/ResourceServicesTest.php index f8a9e6678..1b2452b75 100644 --- a/tests/Bundle/Resource/ResourceServicesTest.php +++ b/tests/Bundle/Resource/ResourceServicesTest.php @@ -19,8 +19,8 @@ use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\ORM\EntityManager; use Sylius\Bundle\ResourceBundle\Controller\ResourceController; -use Sylius\Component\Resource\Factory\FactoryInterface; use Sylius\Component\Resource\Repository\RepositoryInterface; +use Sylius\Resource\Factory\FactoryInterface; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; final class ResourceServicesTest extends WebTestCase