From a72b96be58a276e1a1862d8027104d44c493f801 Mon Sep 17 00:00:00 2001 From: bigboss Date: Tue, 2 Nov 2021 10:53:27 -0300 Subject: [PATCH] improvements --- .github/workflows/build.yml | 4 +- README.md | 2 +- composer.json | 5 +- doc/installation.md | 2 +- phpcs.xml | 4 +- src/Block/VendorJsBlockListener.php | 3 - src/Controller/VendorController.php | 17 --- src/Controller/VendorSlugController.php | 4 - src/DependencyInjection/Configuration.php | 3 - .../OdiseoSyliusVendorExtension.php | 32 ++++- src/Entity/Vendor.php | 123 ++---------------- src/Entity/VendorAwareInterface.php | 6 - src/Entity/VendorEmail.php | 16 +-- src/Entity/VendorEmailInterface.php | 6 - src/Entity/VendorInterface.php | 64 --------- src/Entity/VendorTrait.php | 9 +- src/Entity/VendorTranslation.php | 16 +-- src/Entity/VendorTranslationInterface.php | 6 - src/Entity/VendorsAwareInterface.php | 12 -- src/Entity/VendorsTrait.php | 16 +-- src/Event/VendorFormMenuBuilderEvent.php | 3 +- .../VendorLogoUploadListener.php | 6 +- src/Fixture/Factory/VendorExampleFactory.php | 41 ++---- src/Fixture/VendorFixture.php | 6 - src/Form/Extension/ProductTypeExtension.php | 6 - src/Form/Type/VendorChoiceType.php | 15 +-- src/Form/Type/VendorEmailType.php | 3 - src/Form/Type/VendorTranslationType.php | 3 - src/Form/Type/VendorType.php | 9 -- src/Mapping/VendorAwareListener.php | 34 +---- src/Menu/AdminMenuListener.php | 3 - src/Menu/VendorFormMenuBuilder.php | 7 +- src/Migrations/Version20211102135222.php | 50 +++++++ src/Repository/ProductRepositoryInterface.php | 7 - src/Repository/ProductRepositoryTrait.php | 8 -- src/Repository/VendorRepository.php | 12 -- src/Repository/VendorRepositoryInterface.php | 18 --- src/SitemapProvider/VendorUrlProvider.php | 46 +------ src/Uploader/VendorLogoUploader.php | 22 +--- src/Uploader/VendorLogoUploaderInterface.php | 7 - tests/Application/config/jwt/private.pem | 80 ++++++++---- tests/Application/config/jwt/public.pem | 19 ++- .../Product/Tab/_details.html.twig | 32 ++--- 43 files changed, 207 insertions(+), 580 deletions(-) create mode 100644 src/Migrations/Version20211102135222.php diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f1b8ff6..7da7878 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,11 +21,11 @@ jobs: strategy: fail-fast: false matrix: - php: ["8.0", "7.4"] + php: ["7.4", "8.0"] symfony: ["^4.4", "^5.2"] sylius: ["~1.9.0", "~1.10.0"] node: ["10.x"] - mysql: ["8.0"] + mysql: ["5.7", "8.0"] exclude: - diff --git a/README.md b/README.md index cad8745..52ba590 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Features: * Sitemap: All shop pages are connected with the [Sitemap Plugin](https://github.com/stefandoorn/sitemap-plugin). * Easy to extend: This plugin follows the best practices to make it fully extensible. -Support Sylius version 1.7+. +Support Sylius version 1.9+. #### Premium features! diff --git a/composer.json b/composer.json index b746f40..f8ff11e 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ "license": "MIT", "require": { "php": "^7.4 || ^8.0", - "sylius/sylius": "~1.9.0 || ~1.10.0" + "sylius/sylius": "^1.9" }, "require-dev": { "behat/behat": "^3.6.1", @@ -49,6 +49,9 @@ "config": { "sort-packages": true }, + "conflict": { + "doctrine/dbal": "^3.0" + }, "autoload": { "psr-4": { "Odiseo\\SyliusVendorPlugin\\": "src/", diff --git a/doc/installation.md b/doc/installation.md index 7ee2137..1860954 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -135,7 +135,7 @@ sylius_product: 8. Finish the installation updating the database schema and installing assets ``` -php bin/console doctrine:schema:update --force +php bin/console doctrine:migrations:migrate php bin/console sylius:theme:assets:install php bin/console cache:clear ``` diff --git a/phpcs.xml b/phpcs.xml index 2995253..cc1bda6 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -7,5 +7,7 @@ - + + src/Migrations/* + diff --git a/src/Block/VendorJsBlockListener.php b/src/Block/VendorJsBlockListener.php index 6c2d4e7..0e17319 100644 --- a/src/Block/VendorJsBlockListener.php +++ b/src/Block/VendorJsBlockListener.php @@ -9,9 +9,6 @@ final class VendorJsBlockListener { - /** - * @param BlockEvent $event - */ public function onBlockEvent(BlockEvent $event): void { $template = '@OdiseoSyliusVendorPlugin/Admin/Vendor/_vendor_js.html.twig'; diff --git a/src/Controller/VendorController.php b/src/Controller/VendorController.php index e80f2f2..0254fcc 100644 --- a/src/Controller/VendorController.php +++ b/src/Controller/VendorController.php @@ -16,10 +16,6 @@ class VendorController extends ResourceController { - /** - * @param Request $request - * @return Response - */ public function updateVendorPositionsAction(Request $request): Response { $configuration = $this->requestConfigurationFactory->create($this->metadata, $request); @@ -52,10 +48,6 @@ public function updateVendorPositionsAction(Request $request): Response return $this->redirectHandler->redirectToReferer($configuration); } - /** - * @param Request $request - * @param RequestConfiguration $configuration - */ private function validateCsrfProtection(Request $request, RequestConfiguration $configuration): void { /** @var string|null $token */ @@ -65,20 +57,11 @@ private function validateCsrfProtection(Request $request, RequestConfiguration $ } } - /** - * @param Request $request - * @param array|null $vendors - * @return bool - */ private function shouldProductsPositionsBeUpdated(Request $request, ?array $vendors): bool { return in_array($request->getMethod(), ['POST', 'PUT', 'PATCH'], true) && null !== $vendors; } - /** - * @param string $position - * @param int $id - */ private function updatePositions(string $position, int $id): void { Assert::numeric($position, sprintf('The position "%s" is invalid.', $position)); diff --git a/src/Controller/VendorSlugController.php b/src/Controller/VendorSlugController.php index 07fb8e9..3a74378 100644 --- a/src/Controller/VendorSlugController.php +++ b/src/Controller/VendorSlugController.php @@ -12,10 +12,6 @@ final class VendorSlugController extends AbstractController { - /** - * @param Request $request - * @return Response - */ public function generateAction(Request $request): Response { /** @var string $name */ diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index e2c8d38..d17b5ff 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -9,9 +9,6 @@ final class Configuration implements ConfigurationInterface { - /** - * {@inheritdoc} - */ public function getConfigTreeBuilder(): TreeBuilder { $treeBuilder = new TreeBuilder('odiseo_sylius_vendor_plugin'); diff --git a/src/DependencyInjection/OdiseoSyliusVendorExtension.php b/src/DependencyInjection/OdiseoSyliusVendorExtension.php index b68fc4d..0764c61 100644 --- a/src/DependencyInjection/OdiseoSyliusVendorExtension.php +++ b/src/DependencyInjection/OdiseoSyliusVendorExtension.php @@ -4,17 +4,18 @@ namespace Odiseo\SyliusVendorPlugin\DependencyInjection; +use Sylius\Bundle\CoreBundle\DependencyInjection\PrependDoctrineMigrationsTrait; use Symfony\Component\Config\Definition\ConfigurationInterface; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\Extension; +use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; -final class OdiseoSyliusVendorExtension extends Extension +final class OdiseoSyliusVendorExtension extends Extension implements PrependExtensionInterface { - /** - * {@inheritdoc} - */ + use PrependDoctrineMigrationsTrait; + public function load(array $configs, ContainerBuilder $container): void { $this->processConfiguration($this->getConfiguration([], $container), $configs); @@ -24,11 +25,28 @@ public function load(array $configs, ContainerBuilder $container): void $loader->load('services.yaml'); } - /** - * {@inheritdoc} - */ public function getConfiguration(array $config, ContainerBuilder $container): ConfigurationInterface { return new Configuration(); } + + public function prepend(ContainerBuilder $container): void + { + $this->prependDoctrineMigrations($container); + } + + protected function getMigrationsNamespace(): string + { + return 'Odiseo\SyliusVendorPlugin\Migrations'; + } + + protected function getMigrationsDirectory(): string + { + return '@OdiseoSyliusVendorPlugin/Migrations'; + } + + protected function getNamespacesOfMigrationsExecutedBefore(): array + { + return []; + } } diff --git a/src/Entity/Vendor.php b/src/Entity/Vendor.php index 153b05b..06d5e28 100644 --- a/src/Entity/Vendor.php +++ b/src/Entity/Vendor.php @@ -23,47 +23,28 @@ class Vendor implements VendorInterface use TimestampableTrait; use ToggleableTrait; - /** @var int|null */ - protected $id; - - /** @var string|null */ - protected $name; - - /** @var string|null */ - protected $slug; - - /** @var string|null */ - protected $email; - - /** @var File|null */ - protected $logoFile; - - /** @var string|null */ - protected $logoName; - - /** @var int|null */ - protected $position; + protected ?int $id = null; + protected ?string $name = null; + protected ?string $slug = null; + protected ?string $email = null; + protected ?File $logoFile = null; + protected ?string $logoName = null; + protected ?int $position = null; /** - * @var Collection|ChannelInterface[] - * * @psalm-var Collection */ - protected $channels; + protected Collection $channels; /** - * @var Collection|ProductInterface[] - * * @psalm-var Collection */ - protected $products; + protected Collection $products; /** - * @var Collection|VendorEmailInterface[] - * * @psalm-var Collection */ - protected $extraEmails; + protected Collection $extraEmails; public function __construct() { @@ -75,33 +56,21 @@ public function __construct() $this->createdAt = new \DateTime(); } - /** - * {@inheritdoc} - */ public function getId(): ?int { return $this->id; } - /** - * {@inheritdoc} - */ public function getName(): ?string { return $this->name; } - /** - * {@inheritdoc} - */ public function setName(?string $name): void { $this->name = $name; } - /** - * {@inheritdoc} - */ public function getDescription(): ?string { /** @var VendorTranslationInterface $vendorTranslation */ @@ -110,9 +79,6 @@ public function getDescription(): ?string return $vendorTranslation->getDescription(); } - /** - * {@inheritdoc} - */ public function setDescription(?string $description): void { /** @var VendorTranslationInterface $vendorTranslation */ @@ -121,41 +87,26 @@ public function setDescription(?string $description): void $vendorTranslation->setDescription($description); } - /** - * {@inheritdoc} - */ public function getSlug(): ?string { return $this->slug; } - /** - * {@inheritdoc} - */ public function setSlug(?string $slug = null): void { $this->slug = $slug; } - /** - * {@inheritdoc} - */ public function getEmail(): ?string { return $this->email; } - /** - * {@inheritdoc} - */ public function setEmail(?string $email): void { $this->email = $email; } - /** - * {@inheritdoc} - */ public function setLogoFile(?File $file): void { $this->logoFile = $file; @@ -163,65 +114,41 @@ public function setLogoFile(?File $file): void $this->setUpdatedAt(new \DateTime()); } - /** - * {@inheritdoc} - */ public function getLogoFile(): ?File { return $this->logoFile; } - /** - * {@inheritdoc} - */ public function setLogoName(?string $logoName): void { $this->logoName = $logoName; } - /** - * {@inheritdoc} - */ public function getLogoName(): ?string { return $this->logoName; } - /** - * {@inheritdoc} - */ public function getPosition(): ?int { return $this->position; } - /** - * {@inheritdoc} - */ public function setPosition(?int $position): void { $this->position = $position; } - /** - * {@inheritdoc} - */ public function getChannels(): Collection { return $this->channels; } - /** - * {@inheritdoc} - */ public function hasChannel(ChannelInterface $channel): bool { return $this->channels->contains($channel); } - /** - * {@inheritdoc} - */ public function addChannel(ChannelInterface $channel): void { if (!$this->hasChannel($channel)) { @@ -233,9 +160,6 @@ public function addChannel(ChannelInterface $channel): void } } - /** - * {@inheritdoc} - */ public function removeChannel(ChannelInterface $channel): void { if ($this->hasChannel($channel)) { @@ -247,25 +171,16 @@ public function removeChannel(ChannelInterface $channel): void } } - /** - * {@inheritdoc} - */ public function getProducts(): Collection { return $this->products; } - /** - * {@inheritdoc} - */ public function hasProduct(ProductInterface $product): bool { return $this->products->contains($product); } - /** - * {@inheritdoc} - */ public function addProduct(ProductInterface $product): void { if (!$this->hasProduct($product)) { @@ -277,9 +192,6 @@ public function addProduct(ProductInterface $product): void } } - /** - * {@inheritdoc} - */ public function removeProduct(ProductInterface $product): void { if ($this->hasProduct($product)) { @@ -291,25 +203,16 @@ public function removeProduct(ProductInterface $product): void } } - /** - * {@inheritdoc} - */ public function getExtraEmails(): Collection { return $this->extraEmails; } - /** - * {@inheritdoc} - */ public function hasExtraEmail(VendorEmailInterface $email): bool { return $this->extraEmails->contains($email); } - /** - * {@inheritdoc} - */ public function addExtraEmail(VendorEmailInterface $email): void { if (!$this->hasExtraEmail($email)) { @@ -318,9 +221,6 @@ public function addExtraEmail(VendorEmailInterface $email): void } } - /** - * {@inheritdoc} - */ public function removeExtraEmail(VendorEmailInterface $email): void { if ($this->hasExtraEmail($email)) { @@ -329,9 +229,6 @@ public function removeExtraEmail(VendorEmailInterface $email): void } } - /** - * {@inheritdoc} - */ protected function createTranslation(): TranslationInterface { return new VendorTranslation(); diff --git a/src/Entity/VendorAwareInterface.php b/src/Entity/VendorAwareInterface.php index d13c9cb..1f513d0 100644 --- a/src/Entity/VendorAwareInterface.php +++ b/src/Entity/VendorAwareInterface.php @@ -6,13 +6,7 @@ interface VendorAwareInterface { - /** - * @return VendorInterface|null - */ public function getVendor(): ?VendorInterface; - /** - * @param VendorInterface|null $vendor - */ public function setVendor(?VendorInterface $vendor): void; } diff --git a/src/Entity/VendorEmail.php b/src/Entity/VendorEmail.php index 64ac0bd..2f07aed 100644 --- a/src/Entity/VendorEmail.php +++ b/src/Entity/VendorEmail.php @@ -11,36 +11,24 @@ class VendorEmail implements VendorEmailInterface use VendorTrait; use TimestampableTrait; - /** @var int|null */ - protected $id; - - /** @var string|null */ - protected $value; + protected ?int $id = null; + protected ?string $value = null; public function __construct() { $this->createdAt = new \DateTime(); } - /** - * {@inheritdoc} - */ public function getId(): ?int { return $this->id; } - /** - * {@inheritdoc} - */ public function getValue(): ?string { return $this->value; } - /** - * {@inheritdoc} - */ public function setValue(?string $value): void { $this->value = $value; diff --git a/src/Entity/VendorEmailInterface.php b/src/Entity/VendorEmailInterface.php index dc976cd..e293f35 100644 --- a/src/Entity/VendorEmailInterface.php +++ b/src/Entity/VendorEmailInterface.php @@ -12,13 +12,7 @@ interface VendorEmailInterface extends VendorAwareInterface, TimestampableInterface { - /** - * @return string|null - */ public function getValue(): ?string; - /** - * @param string|null $value - */ public function setValue(?string $value): void; } diff --git a/src/Entity/VendorInterface.php b/src/Entity/VendorInterface.php index fe7adf4..5bd8679 100644 --- a/src/Entity/VendorInterface.php +++ b/src/Entity/VendorInterface.php @@ -23,115 +23,51 @@ interface VendorInterface extends TimestampableInterface, ChannelsAwareInterface { - /** - * @return string|null - */ public function getName(): ?string; - /** - * @param string|null $name - */ public function setName(?string $name): void; - /** - * @return string|null - */ public function getEmail(): ?string; - /** - * @param string|null $email - */ public function setEmail(?string $email): void; - /** - * @param File|null $file - */ public function setLogoFile(?File $file): void; - /** - * @return File|null - */ public function getLogoFile(): ?File; - /** - * @param string|null $logoName - */ public function setLogoName(?string $logoName): void; - /** - * @return string|null - */ public function getLogoName(): ?string; - /** - * @return string|null - */ public function getDescription(): ?string; - /** - * @param string|null $description - */ public function setDescription(?string $description): void; - /** - * @return int|null - */ public function getPosition(): ?int; - /** - * @param int|null $position - */ public function setPosition(?int $position): void; /** - * @return Collection|ProductInterface[] - * * @psalm-return Collection */ public function getProducts(): Collection; - /** - * @param ProductInterface $product - * @return bool - */ public function hasProduct(ProductInterface $product): bool; - /** - * @param ProductInterface $product - */ public function addProduct(ProductInterface $product): void; - /** - * @param ProductInterface $product - */ public function removeProduct(ProductInterface $product): void; /** - * @return Collection|VendorEmailInterface[] - * * @psalm-return Collection */ public function getExtraEmails(): Collection; - /** - * @param VendorEmailInterface $email - * @return bool - */ public function hasExtraEmail(VendorEmailInterface $email): bool; - /** - * @param VendorEmailInterface $email - */ public function addExtraEmail(VendorEmailInterface $email): void; - /** - * @param VendorEmailInterface $email - */ public function removeExtraEmail(VendorEmailInterface $email): void; - /** - * @param string|null $locale - * @return TranslationInterface - */ public function getTranslation(?string $locale = null): TranslationInterface; } diff --git a/src/Entity/VendorTrait.php b/src/Entity/VendorTrait.php index d48592a..6ac9da4 100644 --- a/src/Entity/VendorTrait.php +++ b/src/Entity/VendorTrait.php @@ -6,20 +6,13 @@ trait VendorTrait { - /** @var VendorInterface|null */ - protected $vendor; + protected ?VendorInterface $vendor = null; - /** - * @return VendorInterface|null - */ public function getVendor(): ?VendorInterface { return $this->vendor; } - /** - * @param VendorInterface|null $vendor - */ public function setVendor(?VendorInterface $vendor): void { $this->vendor = $vendor; diff --git a/src/Entity/VendorTranslation.php b/src/Entity/VendorTranslation.php index 2ceff1b..8e843fd 100644 --- a/src/Entity/VendorTranslation.php +++ b/src/Entity/VendorTranslation.php @@ -11,36 +11,24 @@ class VendorTranslation extends AbstractTranslation implements VendorTranslation { use TimestampableTrait; - /** @var int|null */ - protected $id; - - /** @var string|null */ - private $description; + protected ?int $id = null; + private ?string $description = null; public function __construct() { $this->createdAt = new \DateTime(); } - /** - * {@inheritdoc} - */ public function getId(): ?int { return $this->id; } - /** - * {@inheritdoc} - */ public function getDescription(): ?string { return $this->description; } - /** - * {@inheritdoc} - */ public function setDescription(?string $description): void { $this->description = $description; diff --git a/src/Entity/VendorTranslationInterface.php b/src/Entity/VendorTranslationInterface.php index 7bb7e8e..4347af8 100644 --- a/src/Entity/VendorTranslationInterface.php +++ b/src/Entity/VendorTranslationInterface.php @@ -13,13 +13,7 @@ interface VendorTranslationInterface extends TranslationInterface, TimestampableInterface { - /** - * @return string|null - */ public function getDescription(): ?string; - /** - * @param string|null $description - */ public function setDescription(?string $description): void; } diff --git a/src/Entity/VendorsAwareInterface.php b/src/Entity/VendorsAwareInterface.php index 748bf8b..700ee86 100644 --- a/src/Entity/VendorsAwareInterface.php +++ b/src/Entity/VendorsAwareInterface.php @@ -9,25 +9,13 @@ interface VendorsAwareInterface { /** - * @return Collection|VendorInterface[] - * * @psalm-return Collection */ public function getVendors(): Collection; - /** - * @param VendorInterface $vendor - * @return bool - */ public function hasVendor(VendorInterface $vendor): bool; - /** - * @param VendorInterface $vendor - */ public function addVendor(VendorInterface $vendor): void; - /** - * @param VendorInterface $vendor - */ public function removeVendor(VendorInterface $vendor): void; } diff --git a/src/Entity/VendorsTrait.php b/src/Entity/VendorsTrait.php index 769cca2..2f2f307 100644 --- a/src/Entity/VendorsTrait.php +++ b/src/Entity/VendorsTrait.php @@ -9,34 +9,23 @@ trait VendorsTrait { - /** @var Collection|VendorInterface[] */ - protected $vendors; + protected Collection $vendors; public function __construct() { $this->vendors = new ArrayCollection(); } - /** - * @return Collection|VendorInterface[] - */ public function getVendors(): Collection { return $this->vendors; } - /** - * @param VendorInterface $vendor - * @return bool - */ public function hasVendor(VendorInterface $vendor): bool { return $this->vendors->contains($vendor); } - /** - * @param VendorInterface $vendor - */ public function addVendor(VendorInterface $vendor): void { if (!$this->hasVendor($vendor)) { @@ -44,9 +33,6 @@ public function addVendor(VendorInterface $vendor): void } } - /** - * @param VendorInterface $vendor - */ public function removeVendor(VendorInterface $vendor): void { if ($this->hasVendor($vendor)) { diff --git a/src/Event/VendorFormMenuBuilderEvent.php b/src/Event/VendorFormMenuBuilderEvent.php index da2e3c4..c42001f 100644 --- a/src/Event/VendorFormMenuBuilderEvent.php +++ b/src/Event/VendorFormMenuBuilderEvent.php @@ -11,8 +11,7 @@ class VendorFormMenuBuilderEvent extends MenuBuilderEvent { - /** @var VendorInterface */ - private $vendor; + private VendorInterface $vendor; public function __construct(FactoryInterface $factory, ItemInterface $menu, VendorInterface $vendor) { diff --git a/src/EventListener/VendorLogoUploadListener.php b/src/EventListener/VendorLogoUploadListener.php index 2ab1e0f..22a5432 100644 --- a/src/EventListener/VendorLogoUploadListener.php +++ b/src/EventListener/VendorLogoUploadListener.php @@ -11,17 +11,13 @@ final class VendorLogoUploadListener { - /** @var VendorLogoUploaderInterface */ - private $uploader; + private VendorLogoUploaderInterface $uploader; public function __construct(VendorLogoUploaderInterface $uploader) { $this->uploader = $uploader; } - /** - * @param GenericEvent $event - */ public function uploadLogo(GenericEvent $event): void { $vendor = $event->getSubject(); diff --git a/src/Fixture/Factory/VendorExampleFactory.php b/src/Fixture/Factory/VendorExampleFactory.php index 98de1d1..55c7b48 100644 --- a/src/Fixture/Factory/VendorExampleFactory.php +++ b/src/Fixture/Factory/VendorExampleFactory.php @@ -5,6 +5,7 @@ namespace Odiseo\SyliusVendorPlugin\Fixture\Factory; use Faker\Factory; +use Faker\Generator as FakerGenerator; use Generator; use Odiseo\SyliusVendorPlugin\Entity\VendorInterface; use Odiseo\SyliusVendorPlugin\Uploader\VendorLogoUploaderInterface; @@ -21,29 +22,14 @@ class VendorExampleFactory implements ExampleFactoryInterface { - /** @var FactoryInterface */ - protected $vendorFactory; - - /** @var VendorLogoUploaderInterface */ - protected $vendorLogoUploader; - - /** @var RepositoryInterface */ - protected $channelRepository; - - /** @var RepositoryInterface */ - protected $productRepository; - - /** @var RepositoryInterface */ - protected $localeRepository; - - /** @var \Faker\Generator */ - protected $faker; - - /** @var FileLocatorInterface|null */ - protected $fileLocator; - - /** @var OptionsResolver */ - protected $optionsResolver; + protected FactoryInterface $vendorFactory; + protected VendorLogoUploaderInterface $vendorLogoUploader; + protected RepositoryInterface $channelRepository; + protected RepositoryInterface $productRepository; + protected RepositoryInterface $localeRepository; + protected FakerGenerator $faker; + protected ?FileLocatorInterface $fileLocator; + protected OptionsResolver $optionsResolver; public function __construct( FactoryInterface $vendorFactory, @@ -66,9 +52,6 @@ public function __construct( $this->configureOptions($this->optionsResolver); } - /** - * {@inheritdoc} - */ public function create(array $options = []): VendorInterface { $options = $this->optionsResolver->resolve($options); @@ -110,9 +93,6 @@ protected function createImage(string $imagePath): UploadedFile return new UploadedFile($imagePath, basename($imagePath)); } - /** - * @return Generator - */ protected function getLocales(): Generator { /** @var LocaleInterface[] $locales */ @@ -122,9 +102,6 @@ protected function getLocales(): Generator } } - /** - * {@inheritdoc} - */ protected function configureOptions(OptionsResolver $resolver): void { $resolver diff --git a/src/Fixture/VendorFixture.php b/src/Fixture/VendorFixture.php index 24d95ce..07f67f7 100755 --- a/src/Fixture/VendorFixture.php +++ b/src/Fixture/VendorFixture.php @@ -9,9 +9,6 @@ class VendorFixture extends AbstractResourceFixture { - /** - * {@inheritdoc} - */ protected function configureResourceNode(ArrayNodeDefinition $resourceNode): void { $node = $resourceNode->children(); @@ -25,9 +22,6 @@ protected function configureResourceNode(ArrayNodeDefinition $resourceNode): voi $node->scalarNode('description'); } - /** - * {@inheritdoc} - */ public function getName(): string { return 'vendor'; diff --git a/src/Form/Extension/ProductTypeExtension.php b/src/Form/Extension/ProductTypeExtension.php index e6476b4..e94864b 100644 --- a/src/Form/Extension/ProductTypeExtension.php +++ b/src/Form/Extension/ProductTypeExtension.php @@ -11,9 +11,6 @@ final class ProductTypeExtension extends AbstractTypeExtension { - /** - * {@inheritdoc} - */ public function buildForm(FormBuilderInterface $builder, array $options): void { $builder->add('vendor', VendorChoiceType::class, [ @@ -22,9 +19,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void ]); } - /** - * @inheritdoc - */ public static function getExtendedTypes(): iterable { return [ProductType::class]; diff --git a/src/Form/Type/VendorChoiceType.php b/src/Form/Type/VendorChoiceType.php index 42612d8..3306f72 100644 --- a/src/Form/Type/VendorChoiceType.php +++ b/src/Form/Type/VendorChoiceType.php @@ -15,8 +15,7 @@ final class VendorChoiceType extends AbstractType { - /** @var VendorRepositoryInterface */ - private $vendorRepository; + private VendorRepositoryInterface $vendorRepository; public function __construct( VendorRepositoryInterface $vendorRepository @@ -24,9 +23,6 @@ public function __construct( $this->vendorRepository = $vendorRepository; } - /** - * {@inheritdoc} - */ public function buildForm(FormBuilderInterface $builder, array $options): void { /** @var bool $multiple */ @@ -36,9 +32,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void } } - /** - * {@inheritdoc} - */ public function configureOptions(OptionsResolver $resolver): void { $criteria = []; @@ -59,17 +52,11 @@ public function configureOptions(OptionsResolver $resolver): void ]); } - /** - * {@inheritdoc} - */ public function getParent(): string { return ChoiceType::class; } - /** - * {@inheritdoc} - */ public function getBlockPrefix(): string { return 'odiseo_sylius_vendor_choice'; diff --git a/src/Form/Type/VendorEmailType.php b/src/Form/Type/VendorEmailType.php index e8b6340..096e7c5 100644 --- a/src/Form/Type/VendorEmailType.php +++ b/src/Form/Type/VendorEmailType.php @@ -10,9 +10,6 @@ final class VendorEmailType extends AbstractResourceType { - /** - * {@inheritdoc} - */ public function buildForm(FormBuilderInterface $builder, array $options): void { parent::buildForm($builder, $options); diff --git a/src/Form/Type/VendorTranslationType.php b/src/Form/Type/VendorTranslationType.php index 4385322..1361236 100755 --- a/src/Form/Type/VendorTranslationType.php +++ b/src/Form/Type/VendorTranslationType.php @@ -10,9 +10,6 @@ final class VendorTranslationType extends AbstractResourceType { - /** - * {@inheritdoc} - */ public function buildForm(FormBuilderInterface $builder, array $options): void { parent::buildForm($builder, $options); diff --git a/src/Form/Type/VendorType.php b/src/Form/Type/VendorType.php index 6a67dd0..2254bd3 100644 --- a/src/Form/Type/VendorType.php +++ b/src/Form/Type/VendorType.php @@ -19,9 +19,6 @@ final class VendorType extends AbstractResourceType { - /** - * {@inheritdoc} - */ public function buildForm(FormBuilderInterface $builder, array $options): void { parent::buildForm($builder, $options); @@ -63,9 +60,6 @@ public function buildForm(FormBuilderInterface $builder, array $options): void ; } - /** - * {@inheritdoc} - */ public function configureOptions(OptionsResolver $resolver): void { parent::configureOptions($resolver); @@ -84,9 +78,6 @@ public function configureOptions(OptionsResolver $resolver): void ]); } - /** - * {@inheritdoc} - */ public function getBlockPrefix(): string { return 'odiseo_vendor'; diff --git a/src/Mapping/VendorAwareListener.php b/src/Mapping/VendorAwareListener.php index 08dacdd..9ed5270 100644 --- a/src/Mapping/VendorAwareListener.php +++ b/src/Mapping/VendorAwareListener.php @@ -19,17 +19,10 @@ final class VendorAwareListener implements EventSubscriber { - /** @var RegistryInterface */ - private $resourceMetadataRegistry; - - /** @var string */ - private $vendorClass; - - /** @var string */ - private $productClass; - - /** @var string */ - private $channelClass; + private RegistryInterface $resourceMetadataRegistry; + private string $vendorClass; + private string $productClass; + private string $channelClass; public function __construct( RegistryInterface $resourceMetadataRegistry, @@ -43,9 +36,6 @@ public function __construct( $this->channelClass = $channelClass; } - /** - * {@inheritdoc} - */ public function getSubscribedEvents(): array { return [ @@ -53,9 +43,6 @@ public function getSubscribedEvents(): array ]; } - /** - * @param LoadClassMetadataEventArgs $eventArgs - */ public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs): void { $classMetadata = $eventArgs->getClassMetadata(); @@ -87,11 +74,6 @@ public function loadClassMetadata(LoadClassMetadataEventArgs $eventArgs): void } } - /** - * @param ClassMetadata $metadata - * @param string $joinColumn - * @param string $inversedBy - */ private function mapVendorAware(ClassMetadata $metadata, string $joinColumn, string $inversedBy): void { try { @@ -113,11 +95,6 @@ private function mapVendorAware(ClassMetadata $metadata, string $joinColumn, str } } - /** - * @param ClassMetadata $metadata - * @param string $joinColumn - * @param string $inversedBy - */ private function mapVendorsAware(ClassMetadata $metadata, string $joinColumn, string $inversedBy): void { try { @@ -146,9 +123,6 @@ private function mapVendorsAware(ClassMetadata $metadata, string $joinColumn, st } } - /** - * @param ClassMetadata $metadata - */ private function mapVendor(ClassMetadata $metadata): void { try { diff --git a/src/Menu/AdminMenuListener.php b/src/Menu/AdminMenuListener.php index 5e11179..0de7e65 100644 --- a/src/Menu/AdminMenuListener.php +++ b/src/Menu/AdminMenuListener.php @@ -9,9 +9,6 @@ final class AdminMenuListener { - /** - * @param MenuBuilderEvent $event - */ public function addAdminMenuItems(MenuBuilderEvent $event): void { $menu = $event->getMenu(); diff --git a/src/Menu/VendorFormMenuBuilder.php b/src/Menu/VendorFormMenuBuilder.php index 41613fb..e37a105 100644 --- a/src/Menu/VendorFormMenuBuilder.php +++ b/src/Menu/VendorFormMenuBuilder.php @@ -12,11 +12,8 @@ final class VendorFormMenuBuilder { - /** @var FactoryInterface */ - private $factory; - - /** @var EventDispatcherInterface */ - private $eventDispatcher; + private FactoryInterface $factory; + private EventDispatcherInterface $eventDispatcher; public function __construct(FactoryInterface $factory, EventDispatcherInterface $eventDispatcher) { diff --git a/src/Migrations/Version20211102135222.php b/src/Migrations/Version20211102135222.php new file mode 100644 index 0000000..07b2af0 --- /dev/null +++ b/src/Migrations/Version20211102135222.php @@ -0,0 +1,50 @@ +addSql('CREATE TABLE odiseo_vendor (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, slug VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, logo_name VARCHAR(255) NOT NULL, enabled TINYINT(1) NOT NULL, position INT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, UNIQUE INDEX UNIQ_B506F54F5E237E06 (name), UNIQUE INDEX UNIQ_B506F54F989D9B62 (slug), UNIQUE INDEX UNIQ_B506F54FE7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET UTF8 COLLATE `UTF8_unicode_ci` ENGINE = InnoDB'); + $this->addSql('CREATE TABLE odiseo_vendor_email (id INT AUTO_INCREMENT NOT NULL, vendor_id INT NOT NULL, value VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_F58E945BF603EE73 (vendor_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET UTF8 COLLATE `UTF8_unicode_ci` ENGINE = InnoDB'); + $this->addSql('CREATE TABLE odiseo_vendor_translation (id INT AUTO_INCREMENT NOT NULL, translatable_id INT NOT NULL, description LONGTEXT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, locale VARCHAR(255) NOT NULL, INDEX IDX_5F5AE1AB2C2AC5D3 (translatable_id), UNIQUE INDEX odiseo_vendor_translation_uniq_trans (translatable_id, locale), PRIMARY KEY(id)) DEFAULT CHARACTER SET UTF8 COLLATE `UTF8_unicode_ci` ENGINE = InnoDB'); + $this->addSql('CREATE TABLE odiseo_vendor_channels (channel_id INT NOT NULL, vendor_id INT NOT NULL, INDEX IDX_42A3C6D272F5A1AA (channel_id), INDEX IDX_42A3C6D2F603EE73 (vendor_id), PRIMARY KEY(channel_id, vendor_id)) DEFAULT CHARACTER SET UTF8 COLLATE `UTF8_unicode_ci` ENGINE = InnoDB'); + $this->addSql('ALTER TABLE odiseo_vendor_email ADD CONSTRAINT FK_F58E945BF603EE73 FOREIGN KEY (vendor_id) REFERENCES odiseo_vendor (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE odiseo_vendor_translation ADD CONSTRAINT FK_5F5AE1AB2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES odiseo_vendor (id) ON DELETE CASCADE'); + $this->addSql('ALTER TABLE odiseo_vendor_channels ADD CONSTRAINT FK_42A3C6D272F5A1AA FOREIGN KEY (channel_id) REFERENCES sylius_channel (id)'); + $this->addSql('ALTER TABLE odiseo_vendor_channels ADD CONSTRAINT FK_42A3C6D2F603EE73 FOREIGN KEY (vendor_id) REFERENCES odiseo_vendor (id)'); + $this->addSql('ALTER TABLE sylius_product ADD vendor_id INT DEFAULT NULL'); + $this->addSql('ALTER TABLE sylius_product ADD CONSTRAINT FK_677B9B74F603EE73 FOREIGN KEY (vendor_id) REFERENCES odiseo_vendor (id)'); + $this->addSql('CREATE INDEX IDX_677B9B74F603EE73 ON sylius_product (vendor_id)'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE odiseo_vendor_email DROP FOREIGN KEY FK_F58E945BF603EE73'); + $this->addSql('ALTER TABLE odiseo_vendor_translation DROP FOREIGN KEY FK_5F5AE1AB2C2AC5D3'); + $this->addSql('ALTER TABLE odiseo_vendor_channels DROP FOREIGN KEY FK_42A3C6D2F603EE73'); + $this->addSql('ALTER TABLE sylius_product DROP FOREIGN KEY FK_677B9B74F603EE73'); + $this->addSql('DROP TABLE odiseo_vendor'); + $this->addSql('DROP TABLE odiseo_vendor_email'); + $this->addSql('DROP TABLE odiseo_vendor_translation'); + $this->addSql('DROP TABLE odiseo_vendor_channels'); + $this->addSql('DROP INDEX IDX_677B9B74F603EE73 ON sylius_product'); + $this->addSql('ALTER TABLE sylius_product DROP vendor_id'); + } +} diff --git a/src/Repository/ProductRepositoryInterface.php b/src/Repository/ProductRepositoryInterface.php index 4f9e6d1..1caaab4 100644 --- a/src/Repository/ProductRepositoryInterface.php +++ b/src/Repository/ProductRepositoryInterface.php @@ -11,13 +11,6 @@ interface ProductRepositoryInterface extends BaseProductRepositoryInterface { - /** - * @param ChannelInterface $channel - * @param VendorInterface $vendor - * @param string $locale - * @param array $sorting - * @return QueryBuilder - */ public function createShopListByVendorQueryBuilder( ChannelInterface $channel, VendorInterface $vendor, diff --git a/src/Repository/ProductRepositoryTrait.php b/src/Repository/ProductRepositoryTrait.php index 0705197..4ef71fb 100644 --- a/src/Repository/ProductRepositoryTrait.php +++ b/src/Repository/ProductRepositoryTrait.php @@ -10,16 +10,8 @@ trait ProductRepositoryTrait { - /** - * @param $alias - * @param null $indexBy - * @return mixed - */ abstract public function createQueryBuilder($alias, $indexBy = null); - /** - * {@inheritdoc} - */ public function createShopListByVendorQueryBuilder( ChannelInterface $channel, VendorInterface $vendor, diff --git a/src/Repository/VendorRepository.php b/src/Repository/VendorRepository.php index 15766f2..878f314 100644 --- a/src/Repository/VendorRepository.php +++ b/src/Repository/VendorRepository.php @@ -11,9 +11,6 @@ class VendorRepository extends EntityRepository implements VendorRepositoryInterface { - /** - * {@inheritdoc} - */ public function createShopListQueryBuilder( ChannelInterface $channel, array $sorting = [] @@ -21,9 +18,6 @@ public function createShopListQueryBuilder( return $this->findByEnabledQueryBuilder($channel); } - /** - * {@inheritdoc} - */ public function findByEnabledQueryBuilder(?ChannelInterface $channel): QueryBuilder { $queryBuilder = $this->createQueryBuilder('o') @@ -41,17 +35,11 @@ public function findByEnabledQueryBuilder(?ChannelInterface $channel): QueryBuil return $queryBuilder; } - /** - * {@inheritdoc} - */ public function findByChannel(ChannelInterface $channel): array { return $this->findByEnabledQueryBuilder($channel)->getQuery()->getResult(); } - /** - * {@inheritdoc} - */ public function findOneBySlug(string $slug, string $locale): ?VendorInterface { return $this->createQueryBuilder('o') diff --git a/src/Repository/VendorRepositoryInterface.php b/src/Repository/VendorRepositoryInterface.php index e03a911..a5dde72 100644 --- a/src/Repository/VendorRepositoryInterface.php +++ b/src/Repository/VendorRepositoryInterface.php @@ -11,32 +11,14 @@ interface VendorRepositoryInterface extends RepositoryInterface { - /** - * @param ChannelInterface $channel - * @param array $sorting - * @return QueryBuilder - */ public function createShopListQueryBuilder( ChannelInterface $channel, array $sorting = [] ): QueryBuilder; - /** - * @param ChannelInterface|null $channel - * @return QueryBuilder - */ public function findByEnabledQueryBuilder(?ChannelInterface $channel): QueryBuilder; - /** - * @param ChannelInterface $channel - * @return array - */ public function findByChannel(ChannelInterface $channel): array; - /** - * @param string $slug - * @param string $locale - * @return VendorInterface|null - */ public function findOneBySlug(string $slug, string $locale): ?VendorInterface; } diff --git a/src/SitemapProvider/VendorUrlProvider.php b/src/SitemapProvider/VendorUrlProvider.php index 8e432bb..20738ac 100644 --- a/src/SitemapProvider/VendorUrlProvider.php +++ b/src/SitemapProvider/VendorUrlProvider.php @@ -21,23 +21,12 @@ final class VendorUrlProvider implements UrlProviderInterface { - /** @var VendorRepositoryInterface */ - private $vendorRepository; - - /** @var RouterInterface */ - private $router; - - /** @var UrlFactoryInterface */ - private $sitemapUrlFactory; - - /** @var AlternativeUrlFactoryInterface */ - private $urlAlternativeFactory; - - /** @var LocaleContextInterface */ - private $localeContext; - - /** @var ChannelInterface */ - private $channel; + private VendorRepositoryInterface $vendorRepository; + private RouterInterface $router; + private UrlFactoryInterface $sitemapUrlFactory; + private AlternativeUrlFactoryInterface $urlAlternativeFactory; + private LocaleContextInterface $localeContext; + private ChannelInterface $channel; public function __construct( VendorRepositoryInterface $vendorRepository, @@ -53,17 +42,11 @@ public function __construct( $this->localeContext = $localeContext; } - /** - * {@inheritdoc} - */ public function getName(): string { return 'vendors'; } - /** - * {@inheritdoc} - */ public function generate(ChannelInterface $channel): iterable { $this->channel = $channel; @@ -77,9 +60,6 @@ public function generate(ChannelInterface $channel): iterable } /** - * @param VendorInterface $vendor - * @return Collection|TranslationInterface[] - * * @psalm-return Collection */ private function getTranslations(VendorInterface $vendor): Collection @@ -89,26 +69,16 @@ private function getTranslations(VendorInterface $vendor): Collection }); } - /** - * @param TranslationInterface $translation - * @return bool - */ private function localeInLocaleCodes(TranslationInterface $translation): bool { return in_array($translation->getLocale(), $this->getLocaleCodes(), true); } - /** - * @return iterable - */ private function getVendors(): iterable { return $this->vendorRepository->findByChannel($this->channel); } - /** - * @return array - */ private function getLocaleCodes(): array { return $this->channel->getLocales()->map(function (LocaleInterface $locale): ?string { @@ -116,10 +86,6 @@ private function getLocaleCodes(): array })->toArray(); } - /** - * @param VendorInterface $vendor - * @return UrlInterface - */ private function createVendorUrl(VendorInterface $vendor): UrlInterface { $vendorUrl = $this->sitemapUrlFactory->createNew(''); diff --git a/src/Uploader/VendorLogoUploader.php b/src/Uploader/VendorLogoUploader.php index 44fd296..c30dd24 100644 --- a/src/Uploader/VendorLogoUploader.php +++ b/src/Uploader/VendorLogoUploader.php @@ -7,12 +7,10 @@ use Gaufrette\FilesystemInterface; use Odiseo\SyliusVendorPlugin\Entity\VendorInterface; use Symfony\Component\HttpFoundation\File\File; -use Webmozart\Assert\Assert; final class VendorLogoUploader implements VendorLogoUploaderInterface { - /** @var FilesystemInterface */ - private $filesystem; + private FilesystemInterface $filesystem; public function __construct( FilesystemInterface $filesystem @@ -20,9 +18,6 @@ public function __construct( $this->filesystem = $filesystem; } - /** - * {@inheritdoc} - */ public function upload(VendorInterface $vendor): void { if ($vendor->getLogoFile() === null) { @@ -57,9 +52,6 @@ public function upload(VendorInterface $vendor): void ); } - /** - * {@inheritdoc} - */ public function remove(string $path): bool { if ($this->filesystem->has($path)) { @@ -69,19 +61,11 @@ public function remove(string $path): bool return false; } - /** - * @param string $path - * @return bool - */ private function has(string $path): bool { return $this->filesystem->has($path); } - /** - * @param File $file - * @return string - */ private function name(File $file): string { $name = \str_replace('.', '', \uniqid('', true)); @@ -94,10 +78,6 @@ private function name(File $file): string return $name; } - /** - * @param string $path - * @return bool - */ private function isAdBlockingProne(string $path): bool { return strpos($path, 'ad') !== false; diff --git a/src/Uploader/VendorLogoUploaderInterface.php b/src/Uploader/VendorLogoUploaderInterface.php index e94a8ca..fb155e0 100644 --- a/src/Uploader/VendorLogoUploaderInterface.php +++ b/src/Uploader/VendorLogoUploaderInterface.php @@ -8,14 +8,7 @@ interface VendorLogoUploaderInterface { - /** - * @param VendorInterface $vendor - */ public function upload(VendorInterface $vendor): void; - /** - * @param string $path - * @return bool - */ public function remove(string $path): bool; } diff --git a/tests/Application/config/jwt/private.pem b/tests/Application/config/jwt/private.pem index 4e78e84..2bcf023 100644 --- a/tests/Application/config/jwt/private.pem +++ b/tests/Application/config/jwt/private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YBteYmlpVyYrTgXyjnp1rK2zz0118DPFuYiAP +O0r6nnBz0NbwnSKb7S4CjxBKDvDbWTzP35Q5L/vySnO2zRbM64Gw7sjeLiJittWS +gQfbFpEk9k8KVndKM4H50Jp0WznmYpm1Tman8hUOiCvmq0qdI3bJ5Bnj0K+q2zFV ++noGpMFdq1+8WaUFLQFGCPM+yJgCqDgT1RAgfsGcomckGcmenDtHaTbcSFabEdpM +Tsa2qLdg/Kju+7JyGrkmobXl/azuyjYTHfRvSZrvO5WUDFzhChrJpIL4nA3ZGRlS +gvy+OzyyBh4sRyHwLItwUwE81aya3W4llAkhQ7OycmqniJgjtJzLwnxv2RQsB8bF +pyoqQdKVxkqHdbUFeh9igI4ffRAK+8xDER5J+RUoZ4mO8qJebxar54XTb6I/Lepc +g8ITX8bJ/GH+M6JdP7tLCikDTSGS+i1ReMQXE5XuEajYOVbzQdyWU5jleZIx0f6X +mTa4WvMEGNyNxKZZXsy9FAaBkZqrNzEv8k0uFgFMNWQcMMtiqbei86yACdqe+jiW +HqHv8wfoBHR+eIARub2itOJ/cI+oKv96d4it4FqQ9Lml8RUFFZj7Hrd6EjDb6Nq4 +P9ti7eku/xZvS0saBNChvv44GhP6FZJS0i/gidVffLna7Wua98tPZEAXp57k+XUL +PzsRJ4a+hFuQjkyXFoz/v8YuUdyCFUSVVr9ArVu0v4+4euFWpQLav5sXv0Gh9X58 +Ek1KIf7Z/tZAJnSjTjFuSbDX/AoTMTxpRBKKnFW6zY0Nw2pjTVMtTVDkv9xkBpBK +wod7FPD5f0T7y9YOARVZnBxVRSkkcYpEJFy5pLNeadg9 -----END ENCRYPTED PRIVATE KEY----- diff --git a/tests/Application/config/jwt/public.pem b/tests/Application/config/jwt/public.pem index 4d135a9..cb4e13d 100644 --- a/tests/Application/config/jwt/public.pem +++ b/tests/Application/config/jwt/public.pem @@ -1,9 +1,14 @@ -----BEGIN PUBLIC KEY----- -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCA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z2 +wQorQRlCwrkG44VRDgbFH+8CAwEAAQ== -----END PUBLIC KEY----- diff --git a/tests/Application/templates/bundles/SyliusAdminBundle/Product/Tab/_details.html.twig b/tests/Application/templates/bundles/SyliusAdminBundle/Product/Tab/_details.html.twig index d6efa96..f545db2 100644 --- a/tests/Application/templates/bundles/SyliusAdminBundle/Product/Tab/_details.html.twig +++ b/tests/Application/templates/bundles/SyliusAdminBundle/Product/Tab/_details.html.twig @@ -43,25 +43,25 @@ {{ translationFormWithSlug(form.translations, '@SyliusAdmin/Product/_slugField.html.twig', product) }} {% if product.simple %} - -
-
-

{{ 'sylius.ui.shipping'|trans }}

-
- {{ form_row(form.variant.shippingCategory) }} - {{ form_row(form.variant.width) }} - {{ form_row(form.variant.height) }} - {{ form_row(form.variant.depth) }} - {{ form_row(form.variant.weight) }} + +
+
+

{{ 'sylius.ui.shipping'|trans }}

+
+ {{ form_row(form.variant.shippingCategory) }} + {{ form_row(form.variant.width) }} + {{ form_row(form.variant.height) }} + {{ form_row(form.variant.depth) }} + {{ form_row(form.variant.weight) }} +
-
-
-

{{ 'sylius.ui.taxes'|trans }}

-
- {{ form_row(form.variant.taxCategory) }} +
+

{{ 'sylius.ui.taxes'|trans }}

+
+ {{ form_row(form.variant.taxCategory) }} +
-
{% endif %} {{ sylius_template_event(['sylius.admin.product.' ~ action ~ '.tab_details', 'sylius.admin.product.tab_details'], {'form': form}) }}