diff --git a/.github/workflows/refactor.yml b/.github/workflows/refactor.yml new file mode 100644 index 00000000000..1e179b35b08 --- /dev/null +++ b/.github/workflows/refactor.yml @@ -0,0 +1,57 @@ +name: Refactor + +on: + schedule: + - + cron: "0 2 * * MON" # Run at 2am every Monday + workflow_dispatch: ~ + +jobs: + coding-standard: + runs-on: ubuntu-latest + + name: "Coding standard refactor" + + timeout-minutes: 5 + + strategy: + fail-fast: false + matrix: + branch: ["1.10", "1.11", "master"] + + steps: + - + uses: actions/checkout@v3 + with: + ref: ${{ matrix.branch }} + + - + name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.0 # the lowest PHP version working with ECS + + - + name: Install PHP dependencies + run: composer update --no-interaction --no-scripts + + - + name: Run ECS + run: vendor/bin/ecs check --fix src/Sylius + + - + name: Create Pull Request + uses: peter-evans/create-pull-request@v4 + with: + commit-message: '[CS][DX] Refactor' + author: Sylius Bot + title: '[CS][DX] Refactor' + body: | + This PR has been generated automatically. + For more details see [refactor.yml](/Sylius/Sylius/blob/master/.github/workflows/refactor.yml). + labels: | + DX + Enhancement + branch: coding-standard/refactor-${{ matrix.branch }} + delete-branch: true + base: ${{ matrix.branch }} diff --git a/src/Sylius/Behat/Context/Api/Admin/ManagingCustomerGroupsContext.php b/src/Sylius/Behat/Context/Api/Admin/ManagingCustomerGroupsContext.php index 6ba5808b092..253952c26ee 100644 --- a/src/Sylius/Behat/Context/Api/Admin/ManagingCustomerGroupsContext.php +++ b/src/Sylius/Behat/Context/Api/Admin/ManagingCustomerGroupsContext.php @@ -225,8 +225,8 @@ public function iShouldBeNotifiedThatItHasBeenSuccessfullyDeleted(): void { Assert::true( $this->responseChecker->isDeletionSuccessful( - $this->client->getLastResponse() - ), + $this->client->getLastResponse() + ), 'Customer group could not be deleted' ); } diff --git a/src/Sylius/Behat/Context/Api/Admin/ManagingOrdersContext.php b/src/Sylius/Behat/Context/Api/Admin/ManagingOrdersContext.php index 9bea0b66a71..f5a526c2918 100644 --- a/src/Sylius/Behat/Context/Api/Admin/ManagingOrdersContext.php +++ b/src/Sylius/Behat/Context/Api/Admin/ManagingOrdersContext.php @@ -123,10 +123,10 @@ public function iShouldSeeASingleOrderFromCustomer(CustomerInterface $customer): { Assert::true( $this->responseChecker->hasItemWithValue( - $this->client->getLastResponse(), - 'customer', - $this->iriConverter->getIriFromItem($customer) - ), + $this->client->getLastResponse(), + 'customer', + $this->iriConverter->getIriFromItem($customer) + ), sprintf('There is no order for customer %s', $customer->getEmail()) ); } diff --git a/src/Sylius/Behat/Context/Api/Admin/ManagingProductAssociationTypesContext.php b/src/Sylius/Behat/Context/Api/Admin/ManagingProductAssociationTypesContext.php index 008eadee494..84ecf936044 100644 --- a/src/Sylius/Behat/Context/Api/Admin/ManagingProductAssociationTypesContext.php +++ b/src/Sylius/Behat/Context/Api/Admin/ManagingProductAssociationTypesContext.php @@ -146,8 +146,8 @@ public function iShouldBeNotifiedThatItHasBeenSuccessfullyDeleted(): void { Assert::true( $this->responseChecker->isDeletionSuccessful( - $this->client->getLastResponse() - ), + $this->client->getLastResponse() + ), 'Product association type could not be deleted' ); } diff --git a/src/Sylius/Behat/Context/Api/Admin/ManagingZonesContext.php b/src/Sylius/Behat/Context/Api/Admin/ManagingZonesContext.php index 07f1b6dbca3..d67eaae2104 100644 --- a/src/Sylius/Behat/Context/Api/Admin/ManagingZonesContext.php +++ b/src/Sylius/Behat/Context/Api/Admin/ManagingZonesContext.php @@ -406,8 +406,8 @@ public function iShouldBeNotifiedThatItHasBeenSuccessfullyDeleted(): void { Assert::true( $this->responseChecker->isDeletionSuccessful( - $this->client->getLastResponse() - ), + $this->client->getLastResponse() + ), 'Zone could not be deleted' ); } diff --git a/src/Sylius/Behat/Context/Api/Shop/AddressContext.php b/src/Sylius/Behat/Context/Api/Shop/AddressContext.php index a8209f746ef..ca40c17be7c 100644 --- a/src/Sylius/Behat/Context/Api/Shop/AddressContext.php +++ b/src/Sylius/Behat/Context/Api/Shop/AddressContext.php @@ -381,9 +381,9 @@ public function iShouldBeNotifiedThatTheProvinceNeedsToBeSpecified(): void { Assert::true( $this->responseChecker->hasViolationWithMessage( - $this->client->getLastResponse(), - 'Please select proper province.' - ) + $this->client->getLastResponse(), + 'Please select proper province.' + ) ); } diff --git a/src/Sylius/Behat/Context/Cli/CancelUnpaidOrdersContext.php b/src/Sylius/Behat/Context/Cli/CancelUnpaidOrdersContext.php index 763be2a8752..1e368cf08a9 100644 --- a/src/Sylius/Behat/Context/Cli/CancelUnpaidOrdersContext.php +++ b/src/Sylius/Behat/Context/Cli/CancelUnpaidOrdersContext.php @@ -13,13 +13,13 @@ namespace Sylius\Behat\Context\Cli; +use Behat\Behat\Context\Context; use Sylius\Component\Core\OrderPaymentStates; use Sylius\Component\Core\Repository\OrderRepositoryInterface; -use Webmozart\Assert\Assert; -use Behat\Behat\Context\Context; +use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\HttpKernel\KernelInterface; -use Symfony\Bundle\FrameworkBundle\Console\Application; +use Webmozart\Assert\Assert; final class CancelUnpaidOrdersContext implements Context { @@ -64,6 +64,6 @@ public function onlyOrderWithNumberShouldBeCanceled(string $orderNumber): void */ public function shouldBeInformedThatUnpaidOrdersHaveBeenCanceled(): void { - Assert::contains($this->commandTester->getDisplay(), "Unpaid orders have been canceled"); + Assert::contains($this->commandTester->getDisplay(), 'Unpaid orders have been canceled'); } } diff --git a/src/Sylius/Behat/Context/Cli/InstallerContext.php b/src/Sylius/Behat/Context/Cli/InstallerContext.php index c1f136ed78e..8325f250bf9 100644 --- a/src/Sylius/Behat/Context/Cli/InstallerContext.php +++ b/src/Sylius/Behat/Context/Cli/InstallerContext.php @@ -13,11 +13,11 @@ namespace Sylius\Behat\Context\Cli; -use Symfony\Component\Console\Command\Command; use Behat\Behat\Context\Context; use Sylius\Bundle\CoreBundle\Command\InstallSampleDataCommand; use Sylius\Bundle\CoreBundle\Command\SetupCommand; use Symfony\Bundle\FrameworkBundle\Console\Application; +use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\HttpKernel\KernelInterface; use Webmozart\Assert\Assert; diff --git a/src/Sylius/Behat/Context/Cli/ShowingAvailablePluginsContext.php b/src/Sylius/Behat/Context/Cli/ShowingAvailablePluginsContext.php index 73dc7ef2efc..b9bca864f87 100644 --- a/src/Sylius/Behat/Context/Cli/ShowingAvailablePluginsContext.php +++ b/src/Sylius/Behat/Context/Cli/ShowingAvailablePluginsContext.php @@ -13,10 +13,10 @@ namespace Sylius\Behat\Context\Cli; -use Symfony\Component\Console\Command\Command; use Behat\Behat\Context\Context; use Sylius\Bundle\CoreBundle\Command\SetupCommand; use Symfony\Bundle\FrameworkBundle\Console\Application; +use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\HttpKernel\KernelInterface; use Webmozart\Assert\Assert; diff --git a/src/Sylius/Behat/Context/Setup/ProductAttributeContext.php b/src/Sylius/Behat/Context/Setup/ProductAttributeContext.php index 4860e6b82af..11e5e902856 100644 --- a/src/Sylius/Behat/Context/Setup/ProductAttributeContext.php +++ b/src/Sylius/Behat/Context/Setup/ProductAttributeContext.php @@ -13,10 +13,10 @@ namespace Sylius\Behat\Context\Setup; -use Faker\Generator; -use Faker\Factory; use Behat\Behat\Context\Context; use Doctrine\Persistence\ObjectManager; +use Faker\Factory; +use Faker\Generator; use Sylius\Behat\Service\SharedStorageInterface; use Sylius\Component\Attribute\AttributeType\SelectAttributeType; use Sylius\Component\Attribute\Factory\AttributeFactoryInterface; diff --git a/src/Sylius/Behat/Context/Ui/Admin/ManagingOrdersContext.php b/src/Sylius/Behat/Context/Ui/Admin/ManagingOrdersContext.php index cfaeb8b0246..26dc0087624 100644 --- a/src/Sylius/Behat/Context/Ui/Admin/ManagingOrdersContext.php +++ b/src/Sylius/Behat/Context/Ui/Admin/ManagingOrdersContext.php @@ -269,11 +269,11 @@ public function itShouldBeShippedTo( * @Then the order should be billed to :customerName, :street, :postcode, :city, :countryName */ public function itShouldBeBilledToCustomerAtAddress( - string $customerName, - string $street, - string $postcode, - string $city, - string $countryName + string $customerName, + string $street, + string $postcode, + string $city, + string $countryName ) { $this->itShouldBeBilledTo(null, $customerName, $street, $postcode, $city, $countryName); } diff --git a/src/Sylius/Behat/Context/Ui/Shop/LoginContext.php b/src/Sylius/Behat/Context/Ui/Shop/LoginContext.php index 73c897ee395..fc2bef0dd18 100644 --- a/src/Sylius/Behat/Context/Ui/Shop/LoginContext.php +++ b/src/Sylius/Behat/Context/Ui/Shop/LoginContext.php @@ -14,7 +14,6 @@ namespace Sylius\Behat\Context\Ui\Shop; use Behat\Behat\Context\Context; -use FriendsOfBehat\PageObjectExtension\Page\UnexpectedPageException; use Sylius\Behat\Element\Shop\Account\RegisterElementInterface; use Sylius\Behat\NotificationType; use Sylius\Behat\Page\Shop\Account\LoginPageInterface; diff --git a/src/Sylius/Behat/Context/Ui/Shop/ProductContext.php b/src/Sylius/Behat/Context/Ui/Shop/ProductContext.php index 5ed8629f109..5736d8d7a0b 100644 --- a/src/Sylius/Behat/Context/Ui/Shop/ProductContext.php +++ b/src/Sylius/Behat/Context/Ui/Shop/ProductContext.php @@ -254,7 +254,7 @@ public function iCheckListOfProductsForTaxon(TaxonInterface $taxon): void */ public function iTryToBrowseProductsFromTaxonWithATrailingSlashInThePath(TaxonInterface $taxon): void { - $this->indexPage->tryToOpen(['slug' => $taxon->getSlug().'/']); + $this->indexPage->tryToOpen(['slug' => $taxon->getSlug() . '/']); } /** diff --git a/src/Sylius/Behat/Element/Product/ShowPage/VariantsElement.php b/src/Sylius/Behat/Element/Product/ShowPage/VariantsElement.php index 95193b4bf23..0ec74c2d417 100644 --- a/src/Sylius/Behat/Element/Product/ShowPage/VariantsElement.php +++ b/src/Sylius/Behat/Element/Product/ShowPage/VariantsElement.php @@ -57,9 +57,9 @@ private function hasProductWithGivenNameCodePriceAndCurrentStock( $variantContent = $variant->getParent()->find( 'css', sprintf( - '.variants-accordion__content.%s', - explode(' ', $variant->getAttribute('class'))[1] - ) + '.variants-accordion__content.%s', + explode(' ', $variant->getAttribute('class'))[1] + ) ); if ( diff --git a/src/Sylius/Behat/Page/ErrorPageInterface.php b/src/Sylius/Behat/Page/ErrorPageInterface.php index e36123e2885..0d650ab483d 100644 --- a/src/Sylius/Behat/Page/ErrorPageInterface.php +++ b/src/Sylius/Behat/Page/ErrorPageInterface.php @@ -14,6 +14,7 @@ namespace Sylius\Behat\Page; use Behat\Mink\Exception\ElementNotFoundException; + interface ErrorPageInterface { public function getCode(): int; diff --git a/src/Sylius/Behat/Page/Shop/Cart/SummaryPageInterface.php b/src/Sylius/Behat/Page/Shop/Cart/SummaryPageInterface.php index 8e1964300ec..48ce7ad66d2 100644 --- a/src/Sylius/Behat/Page/Shop/Cart/SummaryPageInterface.php +++ b/src/Sylius/Behat/Page/Shop/Cart/SummaryPageInterface.php @@ -21,6 +21,7 @@ interface SummaryPageInterface extends PageInterface public function getGrandTotal(): string; public function getBaseGrandTotal(): string; + public function getIncludedTaxTotal(): string; public function getExcludedTaxTotal(): string; diff --git a/src/Sylius/Behat/Service/SessionManager.php b/src/Sylius/Behat/Service/SessionManager.php index 7bd1f57fc84..ab88f13744a 100644 --- a/src/Sylius/Behat/Service/SessionManager.php +++ b/src/Sylius/Behat/Service/SessionManager.php @@ -66,6 +66,7 @@ private function saveAndRestartSession(string $newSessionName): void $previousSessionName = $this->mink->getDefaultSessionName(); $this->sharedStorage->set('behat_previous_session_name', $previousSessionName); + try { $token = $this->securityService->getCurrentToken(); $this->sharedStorage->set($this->getKeyForToken($previousSessionName), $token); diff --git a/src/Sylius/Bundle/AddressingBundle/Form/Type/CountryChoiceType.php b/src/Sylius/Bundle/AddressingBundle/Form/Type/CountryChoiceType.php index ac0cecc0811..5db227fef60 100644 --- a/src/Sylius/Bundle/AddressingBundle/Form/Type/CountryChoiceType.php +++ b/src/Sylius/Bundle/AddressingBundle/Form/Type/CountryChoiceType.php @@ -62,7 +62,7 @@ public function configureOptions(OptionsResolver $resolver): void $countries = array_filter($countries, $options['choice_filter']); } - usort($countries, static fn(CountryInterface $firstCountry, CountryInterface $secondCountry): int => $firstCountry->getName() <=> $secondCountry->getName()); + usort($countries, static fn (CountryInterface $firstCountry, CountryInterface $secondCountry): int => $firstCountry->getName() <=> $secondCountry->getName()); return $countries; }) diff --git a/src/Sylius/Bundle/AddressingBundle/Form/Type/ZoneType.php b/src/Sylius/Bundle/AddressingBundle/Form/Type/ZoneType.php index dfc29e8f487..142a075ea7b 100644 --- a/src/Sylius/Bundle/AddressingBundle/Form/Type/ZoneType.php +++ b/src/Sylius/Bundle/AddressingBundle/Form/Type/ZoneType.php @@ -67,7 +67,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void ]; if ($zone->getType() === ZoneInterface::TYPE_ZONE) { - $entryOptions['entry_options']['choice_filter'] = static fn(?ZoneInterface $subZone): bool => $subZone !== null && $zone->getId() !== $subZone->getId(); + $entryOptions['entry_options']['choice_filter'] = static fn (?ZoneInterface $subZone): bool => $subZone !== null && $zone->getId() !== $subZone->getId(); } $event->getForm()->add('members', CollectionType::class, [ diff --git a/src/Sylius/Bundle/AddressingBundle/Tests/Form/Type/CountryChoiceTypeTest.php b/src/Sylius/Bundle/AddressingBundle/Tests/Form/Type/CountryChoiceTypeTest.php index 59d40131b49..4be4d5385f3 100644 --- a/src/Sylius/Bundle/AddressingBundle/Tests/Form/Type/CountryChoiceTypeTest.php +++ b/src/Sylius/Bundle/AddressingBundle/Tests/Form/Type/CountryChoiceTypeTest.php @@ -13,8 +13,8 @@ namespace Sylius\Bundle\AddressingBundle\Tests\Form\Type; -use Prophecy\Prophecy\ObjectProphecy; use PHPUnit\Framework\Assert; +use Prophecy\Prophecy\ObjectProphecy; use Prophecy\Prophecy\ProphecyInterface; use Sylius\Bundle\AddressingBundle\Form\Type\CountryChoiceType; use Sylius\Component\Addressing\Model\CountryInterface; @@ -110,7 +110,7 @@ public function it_returns_filtered_out_countries(): void $this->poland->reveal(), ]); - $this->assertChoicesLabels(['Poland'], ['choice_filter' => static fn(?CountryInterface $country): bool => $country !== null && $country->getName() === 'Poland']); + $this->assertChoicesLabels(['Poland'], ['choice_filter' => static fn (?CountryInterface $country): bool => $country !== null && $country->getName() === 'Poland']); } private function assertChoicesLabels(array $expectedLabels, array $formConfiguration = []): void @@ -118,6 +118,6 @@ private function assertChoicesLabels(array $expectedLabels, array $formConfigura $form = $this->factory->create(CountryChoiceType::class, null, $formConfiguration); $view = $form->createView(); - Assert::assertSame($expectedLabels, array_map(static fn(ChoiceView $choiceView): string => $choiceView->label, $view->vars['choices'])); + Assert::assertSame($expectedLabels, array_map(static fn (ChoiceView $choiceView): string => $choiceView->label, $view->vars['choices'])); } } diff --git a/src/Sylius/Bundle/AddressingBundle/Tests/Form/Type/ZoneChoiceTypeTest.php b/src/Sylius/Bundle/AddressingBundle/Tests/Form/Type/ZoneChoiceTypeTest.php index e16f1b3b106..f3d64dfc3d5 100644 --- a/src/Sylius/Bundle/AddressingBundle/Tests/Form/Type/ZoneChoiceTypeTest.php +++ b/src/Sylius/Bundle/AddressingBundle/Tests/Form/Type/ZoneChoiceTypeTest.php @@ -13,8 +13,8 @@ namespace Sylius\Bundle\AddressingBundle\Tests\Form\Type; -use Prophecy\Prophecy\ObjectProphecy; use PHPUnit\Framework\Assert; +use Prophecy\Prophecy\ObjectProphecy; use Prophecy\Prophecy\ProphecyInterface; use Sylius\Bundle\AddressingBundle\Form\Type\ZoneChoiceType; use Sylius\Component\Addressing\Model\Scope as AddressingScope; @@ -136,6 +136,6 @@ private function assertChoicesLabels(array $expectedLabels, array $formConfigura $form = $this->factory->create(ZoneChoiceType::class, null, $formConfiguration); $view = $form->createView(); - Assert::assertSame($expectedLabels, array_map(fn(ChoiceView $choiceView): string => $choiceView->label, $view->vars['choices'])); + Assert::assertSame($expectedLabels, array_map(fn (ChoiceView $choiceView): string => $choiceView->label, $view->vars['choices'])); } } diff --git a/src/Sylius/Bundle/AddressingBundle/spec/Validator/Constraints/ProvinceAddressConstraintValidatorSpec.php b/src/Sylius/Bundle/AddressingBundle/spec/Validator/Constraints/ProvinceAddressConstraintValidatorSpec.php index 01c4e1727e2..ad036af453d 100644 --- a/src/Sylius/Bundle/AddressingBundle/spec/Validator/Constraints/ProvinceAddressConstraintValidatorSpec.php +++ b/src/Sylius/Bundle/AddressingBundle/spec/Validator/Constraints/ProvinceAddressConstraintValidatorSpec.php @@ -19,7 +19,6 @@ use Sylius\Bundle\AddressingBundle\Validator\Constraints\ProvinceAddressConstraintValidator; use Sylius\Component\Addressing\Model\AddressInterface; use Sylius\Component\Addressing\Model\Country; -use Sylius\Component\Addressing\Model\CountryInterface; use Sylius\Component\Addressing\Model\Province; use Sylius\Component\Resource\Repository\RepositoryInterface; use Symfony\Component\Validator\Constraint; diff --git a/src/Sylius/Bundle/AddressingBundle/test/src/Tests/SyliusAddressingBundleTest.php b/src/Sylius/Bundle/AddressingBundle/test/src/Tests/SyliusAddressingBundleTest.php index cbb5ee763ef..17c99b9191c 100644 --- a/src/Sylius/Bundle/AddressingBundle/test/src/Tests/SyliusAddressingBundleTest.php +++ b/src/Sylius/Bundle/AddressingBundle/test/src/Tests/SyliusAddressingBundleTest.php @@ -30,7 +30,7 @@ public function its_services_are_initializable(): void $services = $container->getServiceIds(); - $services = array_filter($services, fn(string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); + $services = array_filter($services, fn (string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); foreach ($services as $id) { Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); diff --git a/src/Sylius/Bundle/AdminBundle/Controller/NotificationController.php b/src/Sylius/Bundle/AdminBundle/Controller/NotificationController.php index 6a3ed6cd740..83ee577a447 100644 --- a/src/Sylius/Bundle/AdminBundle/Controller/NotificationController.php +++ b/src/Sylius/Bundle/AdminBundle/Controller/NotificationController.php @@ -17,7 +17,6 @@ use GuzzleHttp\Exception\GuzzleException; use GuzzleHttp\Psr7\Uri; use Http\Message\MessageFactory; -use Psr\Http\Message\UriInterface; use Sylius\Bundle\CoreBundle\Application\Kernel; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; diff --git a/src/Sylius/Bundle/AdminBundle/Tests/Controller/NotificationControllerTest.php b/src/Sylius/Bundle/AdminBundle/Tests/Controller/NotificationControllerTest.php index 267bd38e2e4..f21b3c6914a 100644 --- a/src/Sylius/Bundle/AdminBundle/Tests/Controller/NotificationControllerTest.php +++ b/src/Sylius/Bundle/AdminBundle/Tests/Controller/NotificationControllerTest.php @@ -13,12 +13,12 @@ namespace Sylius\Bundle\AdminBundle\Tests\Controller; -use Prophecy\Prophecy\ObjectProphecy; use GuzzleHttp\ClientInterface; use GuzzleHttp\Exception\ConnectException; use Http\Message\MessageFactory; use PHPUnit\Framework\TestCase; use Prophecy\Argument; +use Prophecy\Prophecy\ObjectProphecy; use Prophecy\Prophecy\ProphecyInterface; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; diff --git a/src/Sylius/Bundle/AdminBundle/Twig/OrderUnitTaxesExtension.php b/src/Sylius/Bundle/AdminBundle/Twig/OrderUnitTaxesExtension.php index e45984a04bf..13dae9e5aa9 100644 --- a/src/Sylius/Bundle/AdminBundle/Twig/OrderUnitTaxesExtension.php +++ b/src/Sylius/Bundle/AdminBundle/Twig/OrderUnitTaxesExtension.php @@ -43,7 +43,7 @@ private function getAmount(OrderItemInterface $orderItem, bool $neutral): int { $total = array_reduce( $orderItem->getAdjustmentsRecursively(AdjustmentInterface::TAX_ADJUSTMENT)->toArray(), - static fn(int $total, BaseAdjustmentInterface $adjustment) => $neutral === $adjustment->isNeutral() ? $total + $adjustment->getAmount() : $total, + static fn (int $total, BaseAdjustmentInterface $adjustment) => $neutral === $adjustment->isNeutral() ? $total + $adjustment->getAmount() : $total, 0 ); diff --git a/src/Sylius/Bundle/AdminBundle/Twig/ShopExtension.php b/src/Sylius/Bundle/AdminBundle/Twig/ShopExtension.php index 5fcf6a4999e..8604498d87c 100644 --- a/src/Sylius/Bundle/AdminBundle/Twig/ShopExtension.php +++ b/src/Sylius/Bundle/AdminBundle/Twig/ShopExtension.php @@ -25,7 +25,7 @@ public function __construct(private bool $isShopEnabled) public function getFunctions(): array { return [ - new TwigFunction('is_shop_enabled', fn(): bool => $this->isShopEnabled), + new TwigFunction('is_shop_enabled', fn (): bool => $this->isShopEnabled), ]; } } diff --git a/src/Sylius/Bundle/ApiBundle/Command/Account/ChangePaymentMethod.php b/src/Sylius/Bundle/ApiBundle/Command/Account/ChangePaymentMethod.php index 27a980c871e..0bdf6b7e184 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Account/ChangePaymentMethod.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Account/ChangePaymentMethod.php @@ -20,19 +20,19 @@ /** @experimental */ class ChangePaymentMethod implements OrderTokenValueAwareInterface, SubresourceIdAwareInterface, IriToIdentifierConversionAwareInterface { - /** - * @var string|null - */ + /** @var string|null */ public $orderTokenValue; /** * @psalm-immutable + * * @var string|null */ public $paymentId; /** * @psalm-immutable + * * @var string */ public $paymentMethodCode; diff --git a/src/Sylius/Bundle/ApiBundle/Command/Account/ChangeShopUserPassword.php b/src/Sylius/Bundle/ApiBundle/Command/Account/ChangeShopUserPassword.php index 6faa2c118d5..276b4c3da91 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Account/ChangeShopUserPassword.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Account/ChangeShopUserPassword.php @@ -23,18 +23,21 @@ class ChangeShopUserPassword implements ShopUserIdAwareInterface /** * @psalm-immutable + * * @var string|null */ public $newPassword; /** * @psalm-immutable + * * @var string|null */ public $confirmNewPassword; /** * @psalm-immutable + * * @var string|null */ public $currentPassword; diff --git a/src/Sylius/Bundle/ApiBundle/Command/Account/RegisterShopUser.php b/src/Sylius/Bundle/ApiBundle/Command/Account/RegisterShopUser.php index 94fbf3dbcc8..e60c44ad73a 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Account/RegisterShopUser.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Account/RegisterShopUser.php @@ -23,42 +23,43 @@ class RegisterShopUser implements ChannelCodeAwareInterface, LocaleCodeAwareInte { /** * @psalm-immutable + * * @var string */ public $firstName; /** * @psalm-immutable + * * @var string */ public $lastName; /** * @psalm-immutable + * * @var string */ public $email; /** * @psalm-immutable + * * @var string */ public $password; /** * @psalm-immutable + * * @var bool */ public $subscribedToNewsletter; - /** - * @var string|null - */ + /** @var string|null */ public $channelCode; - /** - * @var string|null - */ + /** @var string|null */ public $localeCode; public function __construct( diff --git a/src/Sylius/Bundle/ApiBundle/Command/Account/RequestResetPasswordToken.php b/src/Sylius/Bundle/ApiBundle/Command/Account/RequestResetPasswordToken.php index 383a9d1a450..4a3800ca357 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Account/RequestResetPasswordToken.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Account/RequestResetPasswordToken.php @@ -20,19 +20,13 @@ /** @experimental */ class RequestResetPasswordToken implements ChannelCodeAwareInterface, LocaleCodeAwareInterface, IriToIdentifierConversionAwareInterface { - /** - * @var string - */ + /** @var string */ public $email; - /** - * @var string|null - */ + /** @var string|null */ public $channelCode; - /** - * @var string|null - */ + /** @var string|null */ public $localeCode; public function __construct(string $email) diff --git a/src/Sylius/Bundle/ApiBundle/Command/Account/ResendVerificationEmail.php b/src/Sylius/Bundle/ApiBundle/Command/Account/ResendVerificationEmail.php index fd0d3dda94a..b5269d111cc 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Account/ResendVerificationEmail.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Account/ResendVerificationEmail.php @@ -26,12 +26,14 @@ class ResendVerificationEmail implements ShopUserIdAwareInterface, ChannelCodeAw /** * @psalm-immutable + * * @var string|null */ public $channelCode; /** * @psalm-immutable + * * @var string|null */ public $localeCode; diff --git a/src/Sylius/Bundle/ApiBundle/Command/Account/ResetPassword.php b/src/Sylius/Bundle/ApiBundle/Command/Account/ResetPassword.php index c755741587a..d413a2a62c3 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Account/ResetPassword.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Account/ResetPassword.php @@ -16,19 +16,13 @@ /** @experimental */ class ResetPassword { - /** - * @var string|null - */ + /** @var string|null */ public $newPassword; - /** - * @var string|null - */ + /** @var string|null */ public $confirmNewPassword; - /** - * @var string - */ + /** @var string */ public $resetPasswordToken; public function __construct(string $resetPasswordToken) diff --git a/src/Sylius/Bundle/ApiBundle/Command/Account/SendAccountRegistrationEmail.php b/src/Sylius/Bundle/ApiBundle/Command/Account/SendAccountRegistrationEmail.php index 47bc8acea16..52a8c6f50b9 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Account/SendAccountRegistrationEmail.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Account/SendAccountRegistrationEmail.php @@ -19,19 +19,13 @@ */ class SendAccountRegistrationEmail { - /** - * @var string - */ + /** @var string */ public $shopUserEmail; - /** - * @var string - */ + /** @var string */ public $localeCode; - /** - * @var string - */ + /** @var string */ public $channelCode; public function __construct(string $shopUserEmail, string $localeCode, string $channelCode) diff --git a/src/Sylius/Bundle/ApiBundle/Command/Account/SendAccountVerificationEmail.php b/src/Sylius/Bundle/ApiBundle/Command/Account/SendAccountVerificationEmail.php index 01a4709190f..f6a99c1fdfa 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Account/SendAccountVerificationEmail.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Account/SendAccountVerificationEmail.php @@ -19,19 +19,13 @@ */ class SendAccountVerificationEmail { - /** - * @var string - */ + /** @var string */ public $shopUserEmail; - /** - * @var string - */ + /** @var string */ public $localeCode; - /** - * @var string - */ + /** @var string */ public $channelCode; public function __construct(string $shopUserEmail, string $localeCode, string $channelCode) diff --git a/src/Sylius/Bundle/ApiBundle/Command/Account/SendResetPasswordEmail.php b/src/Sylius/Bundle/ApiBundle/Command/Account/SendResetPasswordEmail.php index 1c25387da15..226a7ac7784 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Account/SendResetPasswordEmail.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Account/SendResetPasswordEmail.php @@ -16,19 +16,13 @@ /** @experimental */ class SendResetPasswordEmail { - /** - * @var string - */ + /** @var string */ public $email; - /** - * @var string - */ + /** @var string */ public $channelCode; - /** - * @var string - */ + /** @var string */ public $localeCode; public function __construct( diff --git a/src/Sylius/Bundle/ApiBundle/Command/Account/VerifyCustomerAccount.php b/src/Sylius/Bundle/ApiBundle/Command/Account/VerifyCustomerAccount.php index 7091ae3b8e5..9c8e79a6646 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Account/VerifyCustomerAccount.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Account/VerifyCustomerAccount.php @@ -19,9 +19,7 @@ */ class VerifyCustomerAccount { - /** - * @var string - */ + /** @var string */ public $token; public function __construct(string $token) diff --git a/src/Sylius/Bundle/ApiBundle/Command/Cart/AddItemToCart.php b/src/Sylius/Bundle/ApiBundle/Command/Cart/AddItemToCart.php index 8f1e31467c8..544f7142ffe 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Cart/AddItemToCart.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Cart/AddItemToCart.php @@ -19,19 +19,19 @@ /** @experimental */ class AddItemToCart implements OrderTokenValueAwareInterface, IriToIdentifierConversionAwareInterface { - /** - * @var string|null - */ + /** @var string|null */ public $orderTokenValue; /** * @psalm-immutable + * * @var string */ public $productVariantCode; /** * @psalm-immutable + * * @var int */ public $quantity; diff --git a/src/Sylius/Bundle/ApiBundle/Command/Cart/BlameCart.php b/src/Sylius/Bundle/ApiBundle/Command/Cart/BlameCart.php index acf5a074da2..b725fa0bee1 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Cart/BlameCart.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Cart/BlameCart.php @@ -18,12 +18,14 @@ class BlameCart { /** * @psalm-immutable + * * @var string */ public $shopUserEmail; /** * @psalm-immutable + * * @var string */ public $orderTokenValue; diff --git a/src/Sylius/Bundle/ApiBundle/Command/Cart/ChangeItemQuantityInCart.php b/src/Sylius/Bundle/ApiBundle/Command/Cart/ChangeItemQuantityInCart.php index 110c82abe0e..cace2725f16 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Cart/ChangeItemQuantityInCart.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Cart/ChangeItemQuantityInCart.php @@ -19,18 +19,15 @@ /** @experimental */ class ChangeItemQuantityInCart implements OrderTokenValueAwareInterface, SubresourceIdAwareInterface { - /** - * @var string|null - */ + /** @var string|null */ public $orderTokenValue; - /** - * @var string|null - */ + /** @var string|null */ public $orderItemId; /** * @psalm-immutable + * * @var int */ public $quantity; diff --git a/src/Sylius/Bundle/ApiBundle/Command/Cart/PickupCart.php b/src/Sylius/Bundle/ApiBundle/Command/Cart/PickupCart.php index 735659aa356..81d9f08da13 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Cart/PickupCart.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Cart/PickupCart.php @@ -22,17 +22,15 @@ class PickupCart implements ChannelCodeAwareInterface, CustomerEmailAwareInterfa { /** * @psalm-immutable - * @var string|null */ - public $tokenValue; - - /** + * * @var string|null */ + public $tokenValue; + + /** @var string|null */ public $localeCode; - /** - * @var string|null - */ + /** @var string|null */ private $channelCode; /** diff --git a/src/Sylius/Bundle/ApiBundle/Command/Cart/RemoveItemFromCart.php b/src/Sylius/Bundle/ApiBundle/Command/Cart/RemoveItemFromCart.php index 39d021eb4ca..be8d80460cf 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Cart/RemoveItemFromCart.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Cart/RemoveItemFromCart.php @@ -18,13 +18,12 @@ /** @experimental */ class RemoveItemFromCart implements OrderTokenValueAwareInterface { - /** - * @var string|null - */ + /** @var string|null */ public $orderTokenValue; /** * @psalm-immutable + * * @var string */ public $itemId; diff --git a/src/Sylius/Bundle/ApiBundle/Command/Catalog/AddProductReview.php b/src/Sylius/Bundle/ApiBundle/Command/Catalog/AddProductReview.php index c5e3ce1a395..5731fc4a115 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Catalog/AddProductReview.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Catalog/AddProductReview.php @@ -21,30 +21,35 @@ class AddProductReview implements IriToIdentifierConversionAwareInterface, Custo { /** * @psalm-immutable + * * @var string|null */ public $title; /** * @psalm-immutable + * * @var int|null */ public $rating; /** * @psalm-immutable + * * @var string|null */ public $comment; /** * @psalm-immutable + * * @var string */ public $productCode; /** * @psalm-immutable + * * @var string|null */ public $email; diff --git a/src/Sylius/Bundle/ApiBundle/Command/Checkout/ChoosePaymentMethod.php b/src/Sylius/Bundle/ApiBundle/Command/Checkout/ChoosePaymentMethod.php index 40e649c4f3a..995a3b59b2b 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Checkout/ChoosePaymentMethod.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Checkout/ChoosePaymentMethod.php @@ -21,19 +21,19 @@ /** @experimental */ class ChoosePaymentMethod implements OrderTokenValueAwareInterface, SubresourceIdAwareInterface, PaymentMethodCodeAwareInterface, IriToIdentifierConversionAwareInterface { - /** - * @var string|null - */ + /** @var string|null */ public $orderTokenValue; /** * @psalm-immutable + * * @var string|null */ public $paymentId; /** * @psalm-immutable + * * @var string|null */ public $paymentMethodCode; diff --git a/src/Sylius/Bundle/ApiBundle/Command/Checkout/ChooseShippingMethod.php b/src/Sylius/Bundle/ApiBundle/Command/Checkout/ChooseShippingMethod.php index bb3f048e1f4..4900d2d0d59 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Checkout/ChooseShippingMethod.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Checkout/ChooseShippingMethod.php @@ -20,18 +20,15 @@ /** @experimental */ class ChooseShippingMethod implements OrderTokenValueAwareInterface, SubresourceIdAwareInterface, IriToIdentifierConversionAwareInterface { - /** - * @var string|null - */ + /** @var string|null */ public $orderTokenValue; - /** - * @var string|null - */ + /** @var string|null */ public $shipmentId; /** * @psalm-immutable + * * @var string */ public $shippingMethodCode; diff --git a/src/Sylius/Bundle/ApiBundle/Command/Checkout/CompleteOrder.php b/src/Sylius/Bundle/ApiBundle/Command/Checkout/CompleteOrder.php index 130463b9536..825c93b4a2b 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Checkout/CompleteOrder.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Checkout/CompleteOrder.php @@ -18,14 +18,10 @@ /** @experimental */ class CompleteOrder implements OrderTokenValueAwareInterface { - /** - * @var string|null - */ + /** @var string|null */ public $orderTokenValue; - /** - * @var string|null - */ + /** @var string|null */ public $notes; public function __construct(?string $notes = null) diff --git a/src/Sylius/Bundle/ApiBundle/Command/Checkout/SendOrderConfirmation.php b/src/Sylius/Bundle/ApiBundle/Command/Checkout/SendOrderConfirmation.php index ac51494f9c2..0450a84877a 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Checkout/SendOrderConfirmation.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Checkout/SendOrderConfirmation.php @@ -16,9 +16,7 @@ /** @experimental */ class SendOrderConfirmation { - /** - * @var string - */ + /** @var string */ public $orderToken; public function __construct(string $orderToken) diff --git a/src/Sylius/Bundle/ApiBundle/Command/Checkout/ShipShipment.php b/src/Sylius/Bundle/ApiBundle/Command/Checkout/ShipShipment.php index 1d7f8a6f8d7..0230cfac65a 100644 --- a/src/Sylius/Bundle/ApiBundle/Command/Checkout/ShipShipment.php +++ b/src/Sylius/Bundle/ApiBundle/Command/Checkout/ShipShipment.php @@ -18,14 +18,10 @@ /** @experimental */ class ShipShipment implements ShipmentIdAwareInterface { - /** - * @var int|null - */ + /** @var int|null */ public $shipmentId; - /** - * @var string|null - */ + /** @var string|null */ public $trackingCode; public function __construct(?string $trackingCode = null) diff --git a/src/Sylius/Bundle/ApiBundle/CommandHandler/Checkout/ChoosePaymentMethodHandler.php b/src/Sylius/Bundle/ApiBundle/CommandHandler/Checkout/ChoosePaymentMethodHandler.php index 37b2f889f84..9c9d0625841 100644 --- a/src/Sylius/Bundle/ApiBundle/CommandHandler/Checkout/ChoosePaymentMethodHandler.php +++ b/src/Sylius/Bundle/ApiBundle/CommandHandler/Checkout/ChoosePaymentMethodHandler.php @@ -66,7 +66,9 @@ public function __invoke(ChoosePaymentMethod $choosePaymentMethod): OrderInterfa $stateMachine = $this->stateMachineFactory->get($cart, OrderCheckoutTransitions::GRAPH); Assert::true( - $stateMachine->can(OrderCheckoutTransitions::TRANSITION_SELECT_PAYMENT), + $stateMachine->can( + OrderCheckoutTransitions::TRANSITION_SELECT_PAYMENT + ), 'Order cannot have payment method assigned.' ); diff --git a/src/Sylius/Bundle/ApiBundle/spec/Serializer/CommandNormalizerSpec.php b/src/Sylius/Bundle/ApiBundle/spec/Serializer/CommandNormalizerSpec.php index c900e862ddd..d18fc5376ec 100644 --- a/src/Sylius/Bundle/ApiBundle/spec/Serializer/CommandNormalizerSpec.php +++ b/src/Sylius/Bundle/ApiBundle/spec/Serializer/CommandNormalizerSpec.php @@ -33,7 +33,12 @@ function it_implements_context_aware_normalizer_interface(): void function it_supports_normalization_if_data_has_get_class_method_and_it_is_missing_constructor_arguments_exception(): void { $this->supportsNormalization( - new class() { public function getClass(): string { return MissingConstructorArgumentsException::class; }} + new class() { + public function getClass(): string + { + return MissingConstructorArgumentsException::class; + } + } )->shouldReturn(true); } @@ -45,7 +50,12 @@ function it_does_not_support_normalization_if_data_has_no_get_class_method(): vo function it_does_not_support_normalization_if_data_class_is_not_missing_constructor_arguments_exception(): void { $this - ->supportsNormalization(new class() { public function getClass(): string { return \Exception::class; }}) + ->supportsNormalization(new class() { + public function getClass(): string + { + return \Exception::class; + } + }) ->shouldReturn(false) ; } @@ -54,7 +64,12 @@ function it_does_not_support_normalization_if_normalizer_has_already_been_called { $this ->supportsNormalization( - new class() { public function getClass(): string { return MissingConstructorArgumentsException::class; }}, + new class() { + public function getClass(): string + { + return MissingConstructorArgumentsException::class; + } + }, null, ['sylius_command_normalizer_already_called' => true] ) diff --git a/src/Sylius/Bundle/ApiBundle/test/config/bootstrap.php b/src/Sylius/Bundle/ApiBundle/test/config/bootstrap.php index 685835a78e1..2fb8800e9e8 100644 --- a/src/Sylius/Bundle/ApiBundle/test/config/bootstrap.php +++ b/src/Sylius/Bundle/ApiBundle/test/config/bootstrap.php @@ -1,5 +1,14 @@ getParameter('kernel.project_dir'); diff --git a/src/Sylius/Bundle/ApiBundle/test/public/index.php b/src/Sylius/Bundle/ApiBundle/test/public/index.php index 377068b60aa..6dbc591fc2e 100644 --- a/src/Sylius/Bundle/ApiBundle/test/public/index.php +++ b/src/Sylius/Bundle/ApiBundle/test/public/index.php @@ -1,5 +1,14 @@ setDefaults([ 'entries' => $this->definedLocalesCodes, - 'entry_name' => fn(string $localeCode): string => $localeCode, - 'entry_options' => fn(string $localeCode): array => [ + 'entry_name' => fn (string $localeCode): string => $localeCode, + 'entry_options' => fn (string $localeCode): array => [ 'required' => $localeCode === $this->defaultLocaleCode, ], ]); diff --git a/src/Sylius/Bundle/AttributeBundle/Tests/Form/Type/AttributeType/SelectAttributeTypeTest.php b/src/Sylius/Bundle/AttributeBundle/Tests/Form/Type/AttributeType/SelectAttributeTypeTest.php index 8b76b04d688..77b6f787fa7 100644 --- a/src/Sylius/Bundle/AttributeBundle/Tests/Form/Type/AttributeType/SelectAttributeTypeTest.php +++ b/src/Sylius/Bundle/AttributeBundle/Tests/Form/Type/AttributeType/SelectAttributeTypeTest.php @@ -13,10 +13,9 @@ namespace Sylius\Bundle\AttributeBundle\Tests\Form\Type\AttributeType; +use PHPUnit\Framework\Assert; use Prophecy\Prophecy\ObjectProphecy; use Sylius\Bundle\AttributeBundle\Form\Type\AttributeType\SelectAttributeType; -use PHPUnit\Framework\Assert; -use Prophecy\Prophecy\ProphecyInterface; use Sylius\Component\Resource\Translation\Provider\TranslationLocaleProviderInterface; use Symfony\Component\Form\ChoiceList\View\ChoiceView; use Symfony\Component\Form\PreloadedExtension; @@ -68,6 +67,6 @@ private function assertChoicesLabels(array $expectedLabels, array $formConfigura ); $view = $form->createView(); - Assert::assertSame($expectedLabels, array_map(fn(ChoiceView $choiceView): string => $choiceView->label, $view->vars['choices'])); + Assert::assertSame($expectedLabels, array_map(fn (ChoiceView $choiceView): string => $choiceView->label, $view->vars['choices'])); } } diff --git a/src/Sylius/Bundle/AttributeBundle/test/src/Tests/SyliusAttributeBundleTest.php b/src/Sylius/Bundle/AttributeBundle/test/src/Tests/SyliusAttributeBundleTest.php index cbd9b4c5028..9981f05df77 100644 --- a/src/Sylius/Bundle/AttributeBundle/test/src/Tests/SyliusAttributeBundleTest.php +++ b/src/Sylius/Bundle/AttributeBundle/test/src/Tests/SyliusAttributeBundleTest.php @@ -30,7 +30,7 @@ public function its_services_are_initializable(): void $services = $container->getServiceIds(); - $services = array_filter($services, fn(string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); + $services = array_filter($services, fn (string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); foreach ($services as $id) { Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); diff --git a/src/Sylius/Bundle/ChannelBundle/Form/Type/ChannelChoiceType.php b/src/Sylius/Bundle/ChannelBundle/Form/Type/ChannelChoiceType.php index 3042fd6355f..84c960c580a 100644 --- a/src/Sylius/Bundle/ChannelBundle/Form/Type/ChannelChoiceType.php +++ b/src/Sylius/Bundle/ChannelBundle/Form/Type/ChannelChoiceType.php @@ -37,7 +37,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ - 'choices' => fn(Options $options): array => $this->channelRepository->findAll(), + 'choices' => fn (Options $options): array => $this->channelRepository->findAll(), 'choice_value' => 'code', 'choice_label' => 'name', 'choice_translation_domain' => false, diff --git a/src/Sylius/Bundle/ChannelBundle/spec/Context/FakeChannel/FakeChannelPersisterSpec.php b/src/Sylius/Bundle/ChannelBundle/spec/Context/FakeChannel/FakeChannelPersisterSpec.php index 8c205540d53..6aef9915eb9 100644 --- a/src/Sylius/Bundle/ChannelBundle/spec/Context/FakeChannel/FakeChannelPersisterSpec.php +++ b/src/Sylius/Bundle/ChannelBundle/spec/Context/FakeChannel/FakeChannelPersisterSpec.php @@ -67,7 +67,7 @@ function it_persists_fake_channel_codes_in_a_cookie( $response->headers = $responseHeaderBag; $responseHeaderBag - ->setCookie(Argument::that(static fn(Cookie $cookie): bool => $cookie->getName() === '_channel_code' && $cookie->getValue() === 'fake_channel_code')) + ->setCookie(Argument::that(static fn (Cookie $cookie): bool => $cookie->getName() === '_channel_code' && $cookie->getValue() === 'fake_channel_code')) ->shouldBeCalled() ; diff --git a/src/Sylius/Bundle/ChannelBundle/test/src/Tests/SyliusChannelBundleTest.php b/src/Sylius/Bundle/ChannelBundle/test/src/Tests/SyliusChannelBundleTest.php index e45a0101d6e..e7997f7c4e7 100644 --- a/src/Sylius/Bundle/ChannelBundle/test/src/Tests/SyliusChannelBundleTest.php +++ b/src/Sylius/Bundle/ChannelBundle/test/src/Tests/SyliusChannelBundleTest.php @@ -30,7 +30,7 @@ public function its_services_are_initializable(): void $services = $container->getServiceIds(); - $services = array_filter($services, fn(string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); + $services = array_filter($services, fn (string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); foreach ($services as $id) { Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); diff --git a/src/Sylius/Bundle/CoreBundle/Application/SyliusPluginTrait.php b/src/Sylius/Bundle/CoreBundle/Application/SyliusPluginTrait.php index 71ce1623e55..c60812772bf 100644 --- a/src/Sylius/Bundle/CoreBundle/Application/SyliusPluginTrait.php +++ b/src/Sylius/Bundle/CoreBundle/Application/SyliusPluginTrait.php @@ -13,9 +13,9 @@ namespace Sylius\Bundle\CoreBundle\Application; -use Symfony\Component\HttpKernel\Bundle\Bundle; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; +use Symfony\Component\HttpKernel\Bundle\Bundle; /** * @mixin Bundle diff --git a/src/Sylius/Bundle/CoreBundle/Command/AbstractInstallCommand.php b/src/Sylius/Bundle/CoreBundle/Command/AbstractInstallCommand.php index c36c5e45e6f..2440d387d86 100644 --- a/src/Sylius/Bundle/CoreBundle/Command/AbstractInstallCommand.php +++ b/src/Sylius/Bundle/CoreBundle/Command/AbstractInstallCommand.php @@ -37,7 +37,7 @@ abstract class AbstractInstallCommand extends ContainerAwareCommand public const WEB_MEDIA_IMAGE_DIRECTORY = 'web/media/image/'; /** @var CommandExecutor|null */ - protected $commandExecutor = null; + protected $commandExecutor; protected function initialize(InputInterface $input, OutputInterface $output) { diff --git a/src/Sylius/Bundle/CoreBundle/Command/CancelUnpaidOrdersCommand.php b/src/Sylius/Bundle/CoreBundle/Command/CancelUnpaidOrdersCommand.php index 7cf79b25818..f914c8a6fae 100644 --- a/src/Sylius/Bundle/CoreBundle/Command/CancelUnpaidOrdersCommand.php +++ b/src/Sylius/Bundle/CoreBundle/Command/CancelUnpaidOrdersCommand.php @@ -45,7 +45,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $this->getContainer()->get('sylius.manager.order')->flush(); - $output->writeln("Unpaid orders have been canceled"); + $output->writeln('Unpaid orders have been canceled'); return 0; } diff --git a/src/Sylius/Bundle/CoreBundle/Controller/ProductTaxonController.php b/src/Sylius/Bundle/CoreBundle/Controller/ProductTaxonController.php index 5de2e5ae817..709457c1e53 100644 --- a/src/Sylius/Bundle/CoreBundle/Controller/ProductTaxonController.php +++ b/src/Sylius/Bundle/CoreBundle/Controller/ProductTaxonController.php @@ -37,7 +37,7 @@ public function updatePositionsAction(Request $request): Response { $configuration = $this->requestConfigurationFactory->create($this->metadata, $request); $this->isGrantedOr403($configuration, ResourceActions::UPDATE); - $productTaxons = $this->getParameterFromRequest($request,'productTaxons'); + $productTaxons = $this->getParameterFromRequest($request, 'productTaxons'); $this->validateCsrfProtection($request, $configuration); if ($this->shouldProductsPositionsBeUpdated($request, $productTaxons)) { @@ -63,7 +63,7 @@ public function updateProductTaxonsPositionsAction(Request $request): Response { $configuration = $this->requestConfigurationFactory->create($this->metadata, $request); $this->isGrantedOr403($configuration, ResourceActions::UPDATE); - $productTaxons = $this->getParameterFromRequest($request,'productTaxons'); + $productTaxons = $this->getParameterFromRequest($request, 'productTaxons'); $this->validateCsrfProtection($request, $configuration); diff --git a/src/Sylius/Bundle/CoreBundle/DependencyInjection/Compiler/RegisterUriBasedSectionResolverPass.php b/src/Sylius/Bundle/CoreBundle/DependencyInjection/Compiler/RegisterUriBasedSectionResolverPass.php index 74f5335ba17..7c84ea50325 100644 --- a/src/Sylius/Bundle/CoreBundle/DependencyInjection/Compiler/RegisterUriBasedSectionResolverPass.php +++ b/src/Sylius/Bundle/CoreBundle/DependencyInjection/Compiler/RegisterUriBasedSectionResolverPass.php @@ -20,7 +20,7 @@ final class RegisterUriBasedSectionResolverPass implements CompilerPassInterface { /** - * {@inheritdoc} + * @inheritdoc */ public function process(ContainerBuilder $container): void { @@ -37,7 +37,7 @@ public function process(ContainerBuilder $container): void } } - usort($uriBasedSectionProviders, static fn(array $a, array $b): int => -($a['priority'] <=> $b['priority'])); + usort($uriBasedSectionProviders, static fn (array $a, array $b): int => -($a['priority'] <=> $b['priority'])); $uriBasedSectionResolver->setArgument(1, array_column($uriBasedSectionProviders, 'id')); } diff --git a/src/Sylius/Bundle/CoreBundle/Doctrine/DQL/DateFormat.php b/src/Sylius/Bundle/CoreBundle/Doctrine/DQL/DateFormat.php index d2bc0b182e7..7000481ae2b 100644 --- a/src/Sylius/Bundle/CoreBundle/Doctrine/DQL/DateFormat.php +++ b/src/Sylius/Bundle/CoreBundle/Doctrine/DQL/DateFormat.php @@ -13,9 +13,9 @@ namespace Sylius\Bundle\CoreBundle\Doctrine\DQL; -use Doctrine\ORM\Query\AST\Node; use Doctrine\ORM\Query\AST\ArithmeticExpression; use Doctrine\ORM\Query\AST\Functions\FunctionNode; +use Doctrine\ORM\Query\AST\Node; use Doctrine\ORM\Query\Lexer; use Doctrine\ORM\Query\Parser; use Doctrine\ORM\Query\SqlWalker; diff --git a/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/AttributeRepository.php b/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/AttributeRepository.php index 8afe3303c96..087e37b332b 100644 --- a/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/AttributeRepository.php +++ b/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/AttributeRepository.php @@ -13,9 +13,8 @@ namespace Sylius\Bundle\CoreBundle\Doctrine\ORM; -use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\EntityManager; -use Doctrine\ORM\Mapping; +use Doctrine\ORM\Mapping\ClassMetadata; use Sylius\Bundle\ResourceBundle\Doctrine\ORM\EntityRepository; use SyliusLabs\AssociationHydrator\AssociationHydrator; diff --git a/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/OrderRepository.php b/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/OrderRepository.php index 9c8fdb89129..a9bf1606645 100644 --- a/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/OrderRepository.php +++ b/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/OrderRepository.php @@ -13,8 +13,8 @@ namespace Sylius\Bundle\CoreBundle\Doctrine\ORM; -use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\EntityManager; +use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\QueryBuilder; use Sylius\Bundle\OrderBundle\Doctrine\ORM\OrderRepository as BaseOrderRepository; use Sylius\Component\Core\Model\ChannelInterface; diff --git a/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/ProductOptionRepository.php b/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/ProductOptionRepository.php index 9bdf626fca6..fec3c3312b4 100644 --- a/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/ProductOptionRepository.php +++ b/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/ProductOptionRepository.php @@ -13,9 +13,8 @@ namespace Sylius\Bundle\CoreBundle\Doctrine\ORM; -use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\EntityManager; -use Doctrine\ORM\Mapping; +use Doctrine\ORM\Mapping\ClassMetadata; use Sylius\Bundle\ProductBundle\Doctrine\ORM\ProductOptionRepository as BaseProductOptionRepository; use SyliusLabs\AssociationHydrator\AssociationHydrator; diff --git a/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/PromotionRepository.php b/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/PromotionRepository.php index 2ab1d483a34..f3cf8088148 100644 --- a/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/PromotionRepository.php +++ b/src/Sylius/Bundle/CoreBundle/Doctrine/ORM/PromotionRepository.php @@ -13,9 +13,8 @@ namespace Sylius\Bundle\CoreBundle\Doctrine\ORM; -use Doctrine\ORM\Mapping\ClassMetadata; use Doctrine\ORM\EntityManager; -use Doctrine\ORM\Mapping; +use Doctrine\ORM\Mapping\ClassMetadata; use Sylius\Bundle\PromotionBundle\Doctrine\ORM\PromotionRepository as BasePromotionRepository; use Sylius\Component\Channel\Model\ChannelInterface; use Sylius\Component\Core\Repository\PromotionRepositoryInterface; diff --git a/src/Sylius/Bundle/CoreBundle/EventListener/LocaleAwareListener.php b/src/Sylius/Bundle/CoreBundle/EventListener/LocaleAwareListener.php index 04e15beb03a..3138e4cd455 100644 --- a/src/Sylius/Bundle/CoreBundle/EventListener/LocaleAwareListener.php +++ b/src/Sylius/Bundle/CoreBundle/EventListener/LocaleAwareListener.php @@ -11,15 +11,6 @@ declare(strict_types=1); -/* - * This file is part of the Sylius package. - * - * (c) Paweł Jędrzejewski - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - namespace Sylius\Bundle\CoreBundle\EventListener; use Symfony\Component\EventDispatcher\EventSubscriberInterface; diff --git a/src/Sylius/Bundle/CoreBundle/Fixture/BookProductFixture.php b/src/Sylius/Bundle/CoreBundle/Fixture/BookProductFixture.php index c752403904a..1704364cb07 100644 --- a/src/Sylius/Bundle/CoreBundle/Fixture/BookProductFixture.php +++ b/src/Sylius/Bundle/CoreBundle/Fixture/BookProductFixture.php @@ -15,8 +15,8 @@ @trigger_error('The "BookProductFixture" class is deprecated since Sylius 1.5 Use new product fixtures class located at "src/Sylius/Bundle/CoreBundle/Fixture/" instead.', \E_USER_DEPRECATED); -use Faker\Generator; use Faker\Factory; +use Faker\Generator; use Sylius\Bundle\FixturesBundle\Fixture\AbstractFixture; use Sylius\Component\Attribute\AttributeType\IntegerAttributeType; use Sylius\Component\Attribute\AttributeType\SelectAttributeType; diff --git a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/AddressExampleFactory.php b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/AddressExampleFactory.php index 2ce48f04431..07e10718be0 100644 --- a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/AddressExampleFactory.php +++ b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/AddressExampleFactory.php @@ -13,9 +13,9 @@ namespace Sylius\Bundle\CoreBundle\Fixture\Factory; -use Faker\Generator; -use Faker\Factory; use Doctrine\Common\Collections\Collection; +use Faker\Factory; +use Faker\Generator; use Sylius\Bundle\CoreBundle\Fixture\OptionsResolver\LazyOption; use Sylius\Component\Addressing\Model\CountryInterface; use Sylius\Component\Addressing\Model\ProvinceInterface; @@ -47,13 +47,13 @@ public function __construct( protected function configureOptions(OptionsResolver $resolver): void { $resolver - ->setDefault('first_name', fn(Options $options): string => $this->faker->firstName) - ->setDefault('last_name', fn(Options $options): string => $this->faker->lastName) - ->setDefault('phone_number', fn(Options $options): ?string => random_int(1, 100) > 50 ? $this->faker->phoneNumber : null) - ->setDefault('company', fn(Options $options): ?string => random_int(1, 100) > 50 ? $this->faker->company : null) - ->setDefault('street', fn(Options $options): string => $this->faker->streetAddress) - ->setDefault('city', fn(Options $options): string => $this->faker->city) - ->setDefault('postcode', fn(Options $options): string => $this->faker->postcode) + ->setDefault('first_name', fn (Options $options): string => $this->faker->firstName) + ->setDefault('last_name', fn (Options $options): string => $this->faker->lastName) + ->setDefault('phone_number', fn (Options $options): ?string => random_int(1, 100) > 50 ? $this->faker->phoneNumber : null) + ->setDefault('company', fn (Options $options): ?string => random_int(1, 100) > 50 ? $this->faker->company : null) + ->setDefault('street', fn (Options $options): string => $this->faker->streetAddress) + ->setDefault('city', fn (Options $options): string => $this->faker->city) + ->setDefault('postcode', fn (Options $options): string => $this->faker->postcode) ->setDefault('country_code', function (Options $options): string { $countries = $this->countryRepository->findAll(); shuffle($countries); diff --git a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ChannelExampleFactory.php b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ChannelExampleFactory.php index b335a73d3aa..aee446c2004 100644 --- a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ChannelExampleFactory.php +++ b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ChannelExampleFactory.php @@ -13,8 +13,8 @@ namespace Sylius\Bundle\CoreBundle\Fixture\Factory; -use Faker\Generator; use Faker\Factory; +use Faker\Generator; use Sylius\Bundle\CoreBundle\Fixture\OptionsResolver\LazyOption; use Sylius\Component\Addressing\Model\Scope as AddressingScope; use Sylius\Component\Addressing\Model\ZoneInterface; @@ -123,10 +123,10 @@ protected function configureOptions(OptionsResolver $resolver): void return $words; }) - ->setDefault('code', fn(Options $options): string => StringInflector::nameToCode($options['name'])) - ->setDefault('hostname', fn(Options $options): string => $options['code'] . '.localhost') - ->setDefault('color', fn(Options $options): string => $this->faker->colorName) - ->setDefault('enabled', fn(Options $options): bool => $this->faker->boolean(90)) + ->setDefault('code', fn (Options $options): string => StringInflector::nameToCode($options['name'])) + ->setDefault('hostname', fn (Options $options): string => $options['code'] . '.localhost') + ->setDefault('color', fn (Options $options): string => $this->faker->colorName) + ->setDefault('enabled', fn (Options $options): bool => $this->faker->boolean(90)) ->setAllowedTypes('enabled', 'bool') ->setDefault('skipping_shipping_step_allowed', false) ->setAllowedTypes('skipping_shipping_step_allowed', 'bool') @@ -145,13 +145,13 @@ protected function configureOptions(OptionsResolver $resolver): void ) ->setDefault('tax_calculation_strategy', 'order_items_based') ->setAllowedTypes('tax_calculation_strategy', 'string') - ->setDefault('default_locale', fn(Options $options): LocaleInterface => $this->faker->randomElement($options['locales'])) + ->setDefault('default_locale', fn (Options $options): LocaleInterface => $this->faker->randomElement($options['locales'])) ->setAllowedTypes('default_locale', ['string', LocaleInterface::class]) ->setNormalizer('default_locale', LazyOption::getOneBy($this->localeRepository, 'code')) ->setDefault('locales', LazyOption::all($this->localeRepository)) ->setAllowedTypes('locales', 'array') ->setNormalizer('locales', LazyOption::findBy($this->localeRepository, 'code')) - ->setDefault('base_currency', fn(Options $options): CurrencyInterface => $this->faker->randomElement($options['currencies'])) + ->setDefault('base_currency', fn (Options $options): CurrencyInterface => $this->faker->randomElement($options['currencies'])) ->setAllowedTypes('base_currency', ['string', CurrencyInterface::class]) ->setNormalizer('base_currency', LazyOption::getOneBy($this->currencyRepository, 'code')) ->setDefault('currencies', LazyOption::all($this->currencyRepository)) diff --git a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/CustomerGroupExampleFactory.php b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/CustomerGroupExampleFactory.php index 7ca444dc331..db92916fef8 100644 --- a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/CustomerGroupExampleFactory.php +++ b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/CustomerGroupExampleFactory.php @@ -13,8 +13,8 @@ namespace Sylius\Bundle\CoreBundle\Fixture\Factory; -use Faker\Generator; use Faker\Factory; +use Faker\Generator; use Sylius\Component\Core\Formatter\StringInflector; use Sylius\Component\Customer\Model\CustomerGroupInterface; use Sylius\Component\Resource\Factory\FactoryInterface; @@ -56,7 +56,7 @@ protected function configureOptions(OptionsResolver $resolver): void return $words; }) - ->setDefault('code', fn(Options $options): string => StringInflector::nameToCode($options['name'])) + ->setDefault('code', fn (Options $options): string => StringInflector::nameToCode($options['name'])) ; } } diff --git a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/OrderExampleFactory.php b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/OrderExampleFactory.php index 91df3afed5e..0c1d9e0edce 100644 --- a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/OrderExampleFactory.php +++ b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/OrderExampleFactory.php @@ -13,9 +13,9 @@ namespace Sylius\Bundle\CoreBundle\Fixture\Factory; -use Faker\Generator; -use Faker\Factory; use Doctrine\Persistence\ObjectManager; +use Faker\Factory; +use Faker\Generator; use SM\Factory\FactoryInterface as StateMachineFactoryInterface; use Sylius\Bundle\CoreBundle\Fixture\OptionsResolver\LazyOption; use Sylius\Component\Addressing\Model\CountryInterface; @@ -100,7 +100,7 @@ protected function configureOptions(OptionsResolver $resolver): void ->setAllowedTypes('country', ['null', 'string', CountryInterface::class]) ->setNormalizer('country', LazyOption::findOneBy($this->countryRepository, 'code')) - ->setDefault('complete_date', fn(Options $options): \DateTimeInterface => $this->faker->dateTimeBetween('-1 years', 'now')) + ->setDefault('complete_date', fn (Options $options): \DateTimeInterface => $this->faker->dateTimeBetween('-1 years', 'now')) ->setAllowedTypes('complete_date', ['null', \DateTime::class]) ->setDefault('fulfilled', false) diff --git a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/PaymentMethodExampleFactory.php b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/PaymentMethodExampleFactory.php index 2e212556357..2a646bc6b22 100644 --- a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/PaymentMethodExampleFactory.php +++ b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/PaymentMethodExampleFactory.php @@ -13,8 +13,8 @@ namespace Sylius\Bundle\CoreBundle\Fixture\Factory; -use Faker\Generator; use Faker\Factory; +use Faker\Generator; use Sylius\Bundle\CoreBundle\Fixture\OptionsResolver\LazyOption; use Sylius\Component\Channel\Repository\ChannelRepositoryInterface; use Sylius\Component\Core\Factory\PaymentMethodFactoryInterface; @@ -81,14 +81,14 @@ protected function configureOptions(OptionsResolver $resolver): void return $words; }) - ->setDefault('code', fn(Options $options): string => StringInflector::nameToCode($options['name'])) - ->setDefault('description', fn(Options $options): string => $this->faker->sentence()) + ->setDefault('code', fn (Options $options): string => StringInflector::nameToCode($options['name'])) + ->setDefault('description', fn (Options $options): string => $this->faker->sentence()) ->setDefault('instructions', null) ->setAllowedTypes('instructions', ['null', 'string']) ->setDefault('gatewayName', 'Offline') ->setDefault('gatewayFactory', 'offline') ->setDefault('gatewayConfig', []) - ->setDefault('enabled', fn(Options $options): bool => $this->faker->boolean(90)) + ->setDefault('enabled', fn (Options $options): bool => $this->faker->boolean(90)) ->setDefault('channels', LazyOption::all($this->channelRepository)) ->setAllowedTypes('channels', 'array') ->setNormalizer('channels', LazyOption::findBy($this->channelRepository, 'code')) diff --git a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ProductAssociationTypeExampleFactory.php b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ProductAssociationTypeExampleFactory.php index 9dce177dd3e..21e26bd09eb 100644 --- a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ProductAssociationTypeExampleFactory.php +++ b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ProductAssociationTypeExampleFactory.php @@ -13,8 +13,8 @@ namespace Sylius\Bundle\CoreBundle\Fixture\Factory; -use Faker\Generator; use Faker\Factory; +use Faker\Generator; use Sylius\Component\Core\Formatter\StringInflector; use Sylius\Component\Locale\Model\LocaleInterface; use Sylius\Component\Product\Model\ProductAssociationTypeInterface; @@ -66,7 +66,7 @@ protected function configureOptions(OptionsResolver $resolver): void return $words; }) - ->setDefault('code', fn(Options $options): string => StringInflector::nameToCode($options['name'])) + ->setDefault('code', fn (Options $options): string => StringInflector::nameToCode($options['name'])) ; } diff --git a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ProductAttributeExampleFactory.php b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ProductAttributeExampleFactory.php index f088eb31065..b145be61497 100644 --- a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ProductAttributeExampleFactory.php +++ b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ProductAttributeExampleFactory.php @@ -13,8 +13,8 @@ namespace Sylius\Bundle\CoreBundle\Fixture\Factory; -use Faker\Generator; use Faker\Factory; +use Faker\Generator; use Sylius\Component\Attribute\Factory\AttributeFactoryInterface; use Sylius\Component\Core\Formatter\StringInflector; use Sylius\Component\Locale\Model\LocaleInterface; @@ -71,9 +71,9 @@ protected function configureOptions(OptionsResolver $resolver): void return $words; }) ->setDefault('translatable', true) - ->setDefault('code', fn(Options $options): string => StringInflector::nameToCode($options['name'])) - ->setDefault('type', fn(Options $options): string => $this->faker->randomElement(array_keys($this->attributeTypes))) - ->setDefault('configuration', fn(Options $options): array => []) + ->setDefault('code', fn (Options $options): string => StringInflector::nameToCode($options['name'])) + ->setDefault('type', fn (Options $options): string => $this->faker->randomElement(array_keys($this->attributeTypes))) + ->setDefault('configuration', fn (Options $options): array => []) ->setAllowedValues('type', array_keys($this->attributeTypes)) ; } diff --git a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ProductOptionExampleFactory.php b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ProductOptionExampleFactory.php index ffe41570275..dc186d2636e 100644 --- a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ProductOptionExampleFactory.php +++ b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ProductOptionExampleFactory.php @@ -13,8 +13,8 @@ namespace Sylius\Bundle\CoreBundle\Fixture\Factory; -use Faker\Generator; use Faker\Factory; +use Faker\Generator; use Sylius\Component\Core\Formatter\StringInflector; use Sylius\Component\Locale\Model\LocaleInterface; use Sylius\Component\Product\Model\ProductOptionInterface; @@ -83,7 +83,7 @@ protected function configureOptions(OptionsResolver $resolver): void return $words; }) - ->setDefault('code', fn(Options $options): string => StringInflector::nameToCode($options['name'])) + ->setDefault('code', fn (Options $options): string => StringInflector::nameToCode($options['name'])) ->setDefault('values', null) ->setDefault('values', function (Options $options, ?array $values): array { if (is_array($values)) { diff --git a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ProductReviewExampleFactory.php b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ProductReviewExampleFactory.php index 7e6d595977c..2d533325a7b 100644 --- a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ProductReviewExampleFactory.php +++ b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ProductReviewExampleFactory.php @@ -13,8 +13,8 @@ namespace Sylius\Bundle\CoreBundle\Fixture\Factory; -use Faker\Generator; use Faker\Factory; +use Faker\Generator; use SM\Factory\FactoryInterface; use Sylius\Bundle\CoreBundle\Fixture\OptionsResolver\LazyOption; use Sylius\Component\Core\Repository\CustomerRepositoryInterface; @@ -71,7 +71,7 @@ protected function configureOptions(OptionsResolver $resolver): void return $words; }) - ->setDefault('rating', fn(Options $options): int => $this->faker->numberBetween(1, 5)) + ->setDefault('rating', fn (Options $options): int => $this->faker->numberBetween(1, 5)) ->setDefault('comment', function (Options $options): string { /** @var string $sentences */ $sentences = $this->faker->sentences(3, true); diff --git a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/PromotionActionExampleFactory.php b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/PromotionActionExampleFactory.php index 4ccf920f629..f53dd15fd9e 100644 --- a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/PromotionActionExampleFactory.php +++ b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/PromotionActionExampleFactory.php @@ -13,8 +13,8 @@ namespace Sylius\Bundle\CoreBundle\Fixture\Factory; -use Faker\Generator; use Faker\Factory; +use Faker\Generator; use Sylius\Component\Core\Factory\PromotionActionFactoryInterface; use Sylius\Component\Core\Promotion\Action\PercentageDiscountPromotionActionCommand; use Sylius\Component\Promotion\Model\PromotionActionInterface; diff --git a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/PromotionRuleExampleFactory.php b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/PromotionRuleExampleFactory.php index 58dd5ac17d4..a01fc413225 100644 --- a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/PromotionRuleExampleFactory.php +++ b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/PromotionRuleExampleFactory.php @@ -13,8 +13,8 @@ namespace Sylius\Bundle\CoreBundle\Fixture\Factory; -use Faker\Generator; use Faker\Factory; +use Faker\Generator; use Sylius\Component\Core\Factory\PromotionRuleFactoryInterface; use Sylius\Component\Promotion\Checker\Rule\CartQuantityRuleChecker; use Sylius\Component\Promotion\Model\PromotionRuleInterface; diff --git a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ShippingCategoryExampleFactory.php b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ShippingCategoryExampleFactory.php index d1f50273e86..f401aec8807 100644 --- a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ShippingCategoryExampleFactory.php +++ b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ShippingCategoryExampleFactory.php @@ -13,8 +13,8 @@ namespace Sylius\Bundle\CoreBundle\Fixture\Factory; -use Faker\Generator; use Faker\Factory; +use Faker\Generator; use Sylius\Component\Core\Formatter\StringInflector; use Sylius\Component\Resource\Factory\FactoryInterface; use Sylius\Component\Shipping\Model\ShippingCategoryInterface; @@ -58,8 +58,8 @@ protected function configureOptions(OptionsResolver $resolver): void return $words; }) - ->setDefault('code', fn(Options $options): string => StringInflector::nameToCode($options['name'])) - ->setDefault('description', fn(Options $options): string => $this->faker->paragraph) + ->setDefault('code', fn (Options $options): string => StringInflector::nameToCode($options['name'])) + ->setDefault('description', fn (Options $options): string => $this->faker->paragraph) ; } } diff --git a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ShopUserExampleFactory.php b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ShopUserExampleFactory.php index e6c03ec1fcb..858239bab9b 100644 --- a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ShopUserExampleFactory.php +++ b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/ShopUserExampleFactory.php @@ -13,8 +13,8 @@ namespace Sylius\Bundle\CoreBundle\Fixture\Factory; -use Faker\Generator; use Faker\Factory; +use Faker\Generator; use Sylius\Bundle\CoreBundle\Fixture\OptionsResolver\LazyOption; use Sylius\Component\Core\Model\CustomerInterface; use Sylius\Component\Core\Model\ShopUserInterface; @@ -69,9 +69,9 @@ public function create(array $options = []): ShopUserInterface protected function configureOptions(OptionsResolver $resolver): void { $resolver - ->setDefault('email', fn(Options $options): string => $this->faker->email) - ->setDefault('first_name', fn(Options $options): string => $this->faker->firstName) - ->setDefault('last_name', fn(Options $options): string => $this->faker->lastName) + ->setDefault('email', fn (Options $options): string => $this->faker->email) + ->setDefault('first_name', fn (Options $options): string => $this->faker->firstName) + ->setDefault('last_name', fn (Options $options): string => $this->faker->lastName) ->setDefault('enabled', true) ->setAllowedTypes('enabled', 'bool') ->setDefault('password', 'password123') @@ -83,8 +83,8 @@ protected function configureOptions(OptionsResolver $resolver): void 'gender', [CustomerComponent::UNKNOWN_GENDER, CustomerComponent::MALE_GENDER, CustomerComponent::FEMALE_GENDER] ) - ->setDefault('phone_number', fn(Options $options): string => $this->faker->phoneNumber) - ->setDefault('birthday', fn(Options $options): \DateTime => $this->faker->dateTimeThisCentury()) + ->setDefault('phone_number', fn (Options $options): string => $this->faker->phoneNumber) + ->setDefault('birthday', fn (Options $options): \DateTime => $this->faker->dateTimeThisCentury()) ->setAllowedTypes('birthday', ['null', 'string', \DateTimeInterface::class]) ->setNormalizer( 'birthday', diff --git a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/TaxCategoryExampleFactory.php b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/TaxCategoryExampleFactory.php index d6803e65300..9f152d67be4 100644 --- a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/TaxCategoryExampleFactory.php +++ b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/TaxCategoryExampleFactory.php @@ -13,8 +13,8 @@ namespace Sylius\Bundle\CoreBundle\Fixture\Factory; -use Faker\Generator; use Faker\Factory; +use Faker\Generator; use Sylius\Component\Core\Formatter\StringInflector; use Sylius\Component\Resource\Factory\FactoryInterface; use Sylius\Component\Taxation\Model\TaxCategoryInterface; @@ -58,8 +58,8 @@ protected function configureOptions(OptionsResolver $resolver): void return $words; }) - ->setDefault('code', fn(Options $options): string => StringInflector::nameToCode($options['name'])) - ->setDefault('description', fn(Options $options): string => $this->faker->paragraph) + ->setDefault('code', fn (Options $options): string => StringInflector::nameToCode($options['name'])) + ->setDefault('description', fn (Options $options): string => $this->faker->paragraph) ; } } diff --git a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/TaxRateExampleFactory.php b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/TaxRateExampleFactory.php index 5927b46e06f..f5738112534 100644 --- a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/TaxRateExampleFactory.php +++ b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/TaxRateExampleFactory.php @@ -13,8 +13,8 @@ namespace Sylius\Bundle\CoreBundle\Fixture\Factory; -use Faker\Generator; use Faker\Factory; +use Faker\Generator; use Sylius\Bundle\CoreBundle\Fixture\OptionsResolver\LazyOption; use Sylius\Component\Addressing\Model\ZoneInterface; use Sylius\Component\Core\Formatter\StringInflector; @@ -63,16 +63,16 @@ public function create(array $options = []): TaxRateInterface protected function configureOptions(OptionsResolver $resolver): void { $resolver - ->setDefault('code', fn(Options $options): string => StringInflector::nameToCode($options['name'])) + ->setDefault('code', fn (Options $options): string => StringInflector::nameToCode($options['name'])) ->setDefault('name', function (Options $options): string { /** @var string $words */ $words = $this->faker->words(3, true); return $words; }) - ->setDefault('amount', fn(Options $options): float => $this->faker->randomFloat(2, 0, 0.4)) + ->setDefault('amount', fn (Options $options): float => $this->faker->randomFloat(2, 0, 0.4)) ->setAllowedTypes('amount', 'float') - ->setDefault('included_in_price', fn(Options $options): bool => $this->faker->boolean()) + ->setDefault('included_in_price', fn (Options $options): bool => $this->faker->boolean()) ->setAllowedTypes('included_in_price', 'bool') ->setDefault('calculator', 'default') ->setDefault('zone', LazyOption::randomOne($this->zoneRepository)) diff --git a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/TaxonExampleFactory.php b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/TaxonExampleFactory.php index 1997b9efb49..b7155155663 100644 --- a/src/Sylius/Bundle/CoreBundle/Fixture/Factory/TaxonExampleFactory.php +++ b/src/Sylius/Bundle/CoreBundle/Fixture/Factory/TaxonExampleFactory.php @@ -13,8 +13,8 @@ namespace Sylius\Bundle\CoreBundle\Fixture\Factory; -use Faker\Generator; use Faker\Factory; +use Faker\Generator; use Sylius\Component\Core\Formatter\StringInflector; use Sylius\Component\Core\Model\TaxonInterface; use Sylius\Component\Locale\Model\LocaleInterface; @@ -104,9 +104,9 @@ protected function configureOptions(OptionsResolver $resolver): void return $words; }) - ->setDefault('code', fn(Options $options): string => StringInflector::nameToCode($options['name'])) + ->setDefault('code', fn (Options $options): string => StringInflector::nameToCode($options['name'])) ->setDefault('slug', null) - ->setDefault('description', fn(Options $options): string => $this->faker->paragraph) + ->setDefault('description', fn (Options $options): string => $this->faker->paragraph) ->setDefault('translations', []) ->setAllowedTypes('translations', ['array']) ->setDefault('children', []) diff --git a/src/Sylius/Bundle/CoreBundle/Fixture/MugProductFixture.php b/src/Sylius/Bundle/CoreBundle/Fixture/MugProductFixture.php index 51293a0e810..b0d2ae1d652 100644 --- a/src/Sylius/Bundle/CoreBundle/Fixture/MugProductFixture.php +++ b/src/Sylius/Bundle/CoreBundle/Fixture/MugProductFixture.php @@ -13,8 +13,9 @@ namespace Sylius\Bundle\CoreBundle\Fixture; -use Faker\Generator; use Faker\Factory; +use Faker\Generator; + @trigger_error('The "MugProductFixture" class is deprecated since Sylius 1.5 Use new product fixtures class located at "src/Sylius/Bundle/CoreBundle/Fixture/" instead.', \E_USER_DEPRECATED); use Sylius\Bundle\FixturesBundle\Fixture\AbstractFixture; diff --git a/src/Sylius/Bundle/CoreBundle/Fixture/OptionsResolver/LazyOption.php b/src/Sylius/Bundle/CoreBundle/Fixture/OptionsResolver/LazyOption.php index dbc70c06d36..187cea6d873 100644 --- a/src/Sylius/Bundle/CoreBundle/Fixture/OptionsResolver/LazyOption.php +++ b/src/Sylius/Bundle/CoreBundle/Fixture/OptionsResolver/LazyOption.php @@ -95,7 +95,7 @@ public static function randomOnes(RepositoryInterface $repository, int $amount, public static function all(RepositoryInterface $repository): \Closure { - return fn(Options $options): iterable => $repository->findAll(); + return fn (Options $options): iterable => $repository->findAll(); } public static function findBy(RepositoryInterface $repository, string $field, array $criteria = []): \Closure diff --git a/src/Sylius/Bundle/CoreBundle/Fixture/OrderFixture.php b/src/Sylius/Bundle/CoreBundle/Fixture/OrderFixture.php index 8a09133557b..2f0a1a74f13 100644 --- a/src/Sylius/Bundle/CoreBundle/Fixture/OrderFixture.php +++ b/src/Sylius/Bundle/CoreBundle/Fixture/OrderFixture.php @@ -13,9 +13,9 @@ namespace Sylius\Bundle\CoreBundle\Fixture; -use Faker\Generator; -use Faker\Factory; use Doctrine\Persistence\ObjectManager; +use Faker\Factory; +use Faker\Generator; use SM\Factory\FactoryInterface as StateMachineFactoryInterface; use Sylius\Bundle\CoreBundle\Fixture\Factory\OrderExampleFactory; use Sylius\Bundle\FixturesBundle\Fixture\AbstractFixture; diff --git a/src/Sylius/Bundle/CoreBundle/Fixture/SimilarProductAssociationFixture.php b/src/Sylius/Bundle/CoreBundle/Fixture/SimilarProductAssociationFixture.php index 7f1d17f00ca..6087593b8b8 100644 --- a/src/Sylius/Bundle/CoreBundle/Fixture/SimilarProductAssociationFixture.php +++ b/src/Sylius/Bundle/CoreBundle/Fixture/SimilarProductAssociationFixture.php @@ -13,8 +13,8 @@ namespace Sylius\Bundle\CoreBundle\Fixture; -use Faker\Generator; use Faker\Factory; +use Faker\Generator; use Sylius\Bundle\FixturesBundle\Fixture\AbstractFixture; use Sylius\Component\Core\Model\ProductInterface; use Sylius\Component\Core\Repository\ProductRepositoryInterface; diff --git a/src/Sylius/Bundle/CoreBundle/Fixture/StickerProductFixture.php b/src/Sylius/Bundle/CoreBundle/Fixture/StickerProductFixture.php index 786b3711ad8..8cf4a5d417a 100644 --- a/src/Sylius/Bundle/CoreBundle/Fixture/StickerProductFixture.php +++ b/src/Sylius/Bundle/CoreBundle/Fixture/StickerProductFixture.php @@ -15,8 +15,8 @@ @trigger_error('The "StickerProductFixture" class is deprecated since Sylius 1.5 Use new product fixtures class located at "src/Sylius/Bundle/CoreBundle/Fixture/" instead.', \E_USER_DEPRECATED); -use Faker\Generator; use Faker\Factory; +use Faker\Generator; use Sylius\Bundle\FixturesBundle\Fixture\AbstractFixture; use Sylius\Component\Attribute\AttributeType\TextAttributeType; use Sylius\Component\Core\Model\ProductInterface; diff --git a/src/Sylius/Bundle/CoreBundle/Fixture/TshirtProductFixture.php b/src/Sylius/Bundle/CoreBundle/Fixture/TshirtProductFixture.php index e04a384becd..c86081e03f0 100644 --- a/src/Sylius/Bundle/CoreBundle/Fixture/TshirtProductFixture.php +++ b/src/Sylius/Bundle/CoreBundle/Fixture/TshirtProductFixture.php @@ -13,8 +13,9 @@ namespace Sylius\Bundle\CoreBundle\Fixture; -use Faker\Generator; use Faker\Factory; +use Faker\Generator; + @trigger_error('The "TshirtProductFixture" class is deprecated since Sylius 1.5 Use new product fixtures class located at "src/Sylius/Bundle/CoreBundle/Fixture/" instead.', \E_USER_DEPRECATED); use Sylius\Bundle\FixturesBundle\Fixture\AbstractFixture; diff --git a/src/Sylius/Bundle/CoreBundle/Form/DataTransformer/TaxonsToCodesTransformer.php b/src/Sylius/Bundle/CoreBundle/Form/DataTransformer/TaxonsToCodesTransformer.php index 1125eae6f09..bf563582e97 100644 --- a/src/Sylius/Bundle/CoreBundle/Form/DataTransformer/TaxonsToCodesTransformer.php +++ b/src/Sylius/Bundle/CoreBundle/Form/DataTransformer/TaxonsToCodesTransformer.php @@ -47,6 +47,6 @@ public function reverseTransform($value): array { Assert::isInstanceOf($value, Collection::class); - return array_map(fn(TaxonInterface $taxon) => $taxon->getCode(), $value->toArray()); + return array_map(fn (TaxonInterface $taxon) => $taxon->getCode(), $value->toArray()); } } diff --git a/src/Sylius/Bundle/CoreBundle/Form/Extension/CartTypeExtension.php b/src/Sylius/Bundle/CoreBundle/Form/Extension/CartTypeExtension.php index 3742c25fe24..2a1d1189a7e 100644 --- a/src/Sylius/Bundle/CoreBundle/Form/Extension/CartTypeExtension.php +++ b/src/Sylius/Bundle/CoreBundle/Form/Extension/CartTypeExtension.php @@ -39,7 +39,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void public function configureOptions(OptionsResolver $resolver): void { - $resolver->setNormalizer('validation_groups', fn(Options $options, array $validationGroups) => function (FormInterface $form) use ($validationGroups) { + $resolver->setNormalizer('validation_groups', fn (Options $options, array $validationGroups) => function (FormInterface $form) use ($validationGroups) { if ((bool) $form->get('promotionCoupon')->getNormData()) { // Validate the coupon if it was sent $validationGroups[] = 'sylius_promotion_coupon'; } diff --git a/src/Sylius/Bundle/CoreBundle/Form/Extension/ProductVariantGenerationTypeExtension.php b/src/Sylius/Bundle/CoreBundle/Form/Extension/ProductVariantGenerationTypeExtension.php index 2123e443746..f252be58ae4 100644 --- a/src/Sylius/Bundle/CoreBundle/Form/Extension/ProductVariantGenerationTypeExtension.php +++ b/src/Sylius/Bundle/CoreBundle/Form/Extension/ProductVariantGenerationTypeExtension.php @@ -31,7 +31,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void $event->getForm()->add('channelPricings', ChannelCollectionType::class, [ 'entry_type' => ChannelPricingType::class, - 'entry_options' => fn(ChannelInterface $channel) => [ + 'entry_options' => fn (ChannelInterface $channel) => [ 'channel' => $channel, 'product_variant' => $productVariant, ], diff --git a/src/Sylius/Bundle/CoreBundle/Form/Extension/ProductVariantTypeExtension.php b/src/Sylius/Bundle/CoreBundle/Form/Extension/ProductVariantTypeExtension.php index 4a2d10070eb..1eb9d6386f3 100644 --- a/src/Sylius/Bundle/CoreBundle/Form/Extension/ProductVariantTypeExtension.php +++ b/src/Sylius/Bundle/CoreBundle/Form/Extension/ProductVariantTypeExtension.php @@ -81,7 +81,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void $event->getForm()->add('channelPricings', ChannelCollectionType::class, [ 'entry_type' => ChannelPricingType::class, - 'entry_options' => fn(ChannelInterface $channel) => [ + 'entry_options' => fn (ChannelInterface $channel) => [ 'channel' => $channel, 'product_variant' => $productVariant, 'required' => false, diff --git a/src/Sylius/Bundle/CoreBundle/Form/Type/AmountType.php b/src/Sylius/Bundle/CoreBundle/Form/Type/AmountType.php index 630f376068f..f270b8e4d9d 100644 --- a/src/Sylius/Bundle/CoreBundle/Form/Type/AmountType.php +++ b/src/Sylius/Bundle/CoreBundle/Form/Type/AmountType.php @@ -47,7 +47,7 @@ public function configureOptions(OptionsResolver $resolver): void ->setAllowedTypes('channel', [ChannelInterface::class]) ->setDefaults([ - 'label' => static fn(Options $options): string => $options['channel']->getName(), + 'label' => static fn (Options $options): string => $options['channel']->getName(), ]) ; } diff --git a/src/Sylius/Bundle/CoreBundle/Form/Type/ChannelCollectionType.php b/src/Sylius/Bundle/CoreBundle/Form/Type/ChannelCollectionType.php index 57e606d02cb..8c713fc9e15 100644 --- a/src/Sylius/Bundle/CoreBundle/Form/Type/ChannelCollectionType.php +++ b/src/Sylius/Bundle/CoreBundle/Form/Type/ChannelCollectionType.php @@ -29,7 +29,7 @@ public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'entries' => $this->channelRepository->findAll(), - 'entry_name' => fn(ChannelInterface $channel) => $channel->getCode(), + 'entry_name' => fn (ChannelInterface $channel) => $channel->getCode(), 'error_bubbling' => false, ]); } diff --git a/src/Sylius/Bundle/CoreBundle/Form/Type/Checkout/AddressType.php b/src/Sylius/Bundle/CoreBundle/Form/Type/Checkout/AddressType.php index 7dcb0eec109..5dc52e346ed 100644 --- a/src/Sylius/Bundle/CoreBundle/Form/Type/Checkout/AddressType.php +++ b/src/Sylius/Bundle/CoreBundle/Form/Type/Checkout/AddressType.php @@ -51,7 +51,7 @@ public function __construct(string $dataClass, array $validationGroups = [], ?Ad } /** - * {@inheritdoc} + * @inheritdoc */ public function buildForm(FormBuilderInterface $builder, array $options): void { diff --git a/src/Sylius/Bundle/CoreBundle/Form/Type/Product/ChannelPricingType.php b/src/Sylius/Bundle/CoreBundle/Form/Type/Product/ChannelPricingType.php index d44eed751aa..2f1d8833384 100644 --- a/src/Sylius/Bundle/CoreBundle/Form/Type/Product/ChannelPricingType.php +++ b/src/Sylius/Bundle/CoreBundle/Form/Type/Product/ChannelPricingType.php @@ -92,7 +92,7 @@ public function configureOptions(OptionsResolver $resolver): void ->setAllowedTypes('product_variant', ['null', ProductVariantInterface::class]) ->setDefaults([ - 'label' => fn(Options $options): string => $options['channel']->getName(), + 'label' => fn (Options $options): string => $options['channel']->getName(), ]) ; } diff --git a/src/Sylius/Bundle/CoreBundle/Form/Type/Promotion/Action/ChannelBasedFixedDiscountConfigurationType.php b/src/Sylius/Bundle/CoreBundle/Form/Type/Promotion/Action/ChannelBasedFixedDiscountConfigurationType.php index c65a5fb5328..9bdd3da120a 100644 --- a/src/Sylius/Bundle/CoreBundle/Form/Type/Promotion/Action/ChannelBasedFixedDiscountConfigurationType.php +++ b/src/Sylius/Bundle/CoreBundle/Form/Type/Promotion/Action/ChannelBasedFixedDiscountConfigurationType.php @@ -25,7 +25,7 @@ public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'entry_type' => FixedDiscountConfigurationType::class, - 'entry_options' => fn(ChannelInterface $channel) => [ + 'entry_options' => fn (ChannelInterface $channel) => [ 'label' => $channel->getName(), 'currency' => $channel->getBaseCurrency()->getCode(), ], diff --git a/src/Sylius/Bundle/CoreBundle/Form/Type/Promotion/Action/ChannelBasedUnitFixedDiscountConfigurationType.php b/src/Sylius/Bundle/CoreBundle/Form/Type/Promotion/Action/ChannelBasedUnitFixedDiscountConfigurationType.php index e75a29e4744..d3e0d61cf5c 100644 --- a/src/Sylius/Bundle/CoreBundle/Form/Type/Promotion/Action/ChannelBasedUnitFixedDiscountConfigurationType.php +++ b/src/Sylius/Bundle/CoreBundle/Form/Type/Promotion/Action/ChannelBasedUnitFixedDiscountConfigurationType.php @@ -25,7 +25,7 @@ public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'entry_type' => UnitFixedDiscountConfigurationType::class, - 'entry_options' => fn(ChannelInterface $channel) => [ + 'entry_options' => fn (ChannelInterface $channel) => [ 'label' => $channel->getName(), 'currency' => $channel->getBaseCurrency()->getCode(), ], diff --git a/src/Sylius/Bundle/CoreBundle/Form/Type/Promotion/Action/ChannelBasedUnitPercentageDiscountConfigurationType.php b/src/Sylius/Bundle/CoreBundle/Form/Type/Promotion/Action/ChannelBasedUnitPercentageDiscountConfigurationType.php index 8805e1bb1d2..f522020e707 100644 --- a/src/Sylius/Bundle/CoreBundle/Form/Type/Promotion/Action/ChannelBasedUnitPercentageDiscountConfigurationType.php +++ b/src/Sylius/Bundle/CoreBundle/Form/Type/Promotion/Action/ChannelBasedUnitPercentageDiscountConfigurationType.php @@ -25,7 +25,7 @@ public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'entry_type' => UnitPercentageDiscountConfigurationType::class, - 'entry_options' => fn(ChannelInterface $channel) => [ + 'entry_options' => fn (ChannelInterface $channel) => [ 'label' => $channel->getName(), 'currency' => $channel->getBaseCurrency()->getCode(), ], diff --git a/src/Sylius/Bundle/CoreBundle/Form/Type/Promotion/Rule/ChannelBasedItemTotalConfigurationType.php b/src/Sylius/Bundle/CoreBundle/Form/Type/Promotion/Rule/ChannelBasedItemTotalConfigurationType.php index 933e63b0686..4e1a70f7531 100644 --- a/src/Sylius/Bundle/CoreBundle/Form/Type/Promotion/Rule/ChannelBasedItemTotalConfigurationType.php +++ b/src/Sylius/Bundle/CoreBundle/Form/Type/Promotion/Rule/ChannelBasedItemTotalConfigurationType.php @@ -25,7 +25,7 @@ public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'entry_type' => ItemTotalConfigurationType::class, - 'entry_options' => fn(ChannelInterface $channel) => [ + 'entry_options' => fn (ChannelInterface $channel) => [ 'label' => $channel->getName(), 'currency' => $channel->getBaseCurrency()->getCode(), ], diff --git a/src/Sylius/Bundle/CoreBundle/Form/Type/Promotion/Rule/ChannelBasedTotalOfItemsFromTaxonConfigurationType.php b/src/Sylius/Bundle/CoreBundle/Form/Type/Promotion/Rule/ChannelBasedTotalOfItemsFromTaxonConfigurationType.php index 56b44ab47e7..7451a2a92b9 100644 --- a/src/Sylius/Bundle/CoreBundle/Form/Type/Promotion/Rule/ChannelBasedTotalOfItemsFromTaxonConfigurationType.php +++ b/src/Sylius/Bundle/CoreBundle/Form/Type/Promotion/Rule/ChannelBasedTotalOfItemsFromTaxonConfigurationType.php @@ -24,7 +24,7 @@ public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'entry_type' => TotalOfItemsFromTaxonConfigurationType::class, - 'entry_options' => fn(ChannelInterface $channel): array => [ + 'entry_options' => fn (ChannelInterface $channel): array => [ 'label' => $channel->getName(), 'currency' => $channel->getBaseCurrency()->getCode(), ], diff --git a/src/Sylius/Bundle/CoreBundle/Form/Type/Shipping/Calculator/ChannelBasedFlatRateConfigurationType.php b/src/Sylius/Bundle/CoreBundle/Form/Type/Shipping/Calculator/ChannelBasedFlatRateConfigurationType.php index b26df4db292..7b4610000c6 100644 --- a/src/Sylius/Bundle/CoreBundle/Form/Type/Shipping/Calculator/ChannelBasedFlatRateConfigurationType.php +++ b/src/Sylius/Bundle/CoreBundle/Form/Type/Shipping/Calculator/ChannelBasedFlatRateConfigurationType.php @@ -25,7 +25,7 @@ public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'entry_type' => FlatRateConfigurationType::class, - 'entry_options' => fn(ChannelInterface $channel): array => [ + 'entry_options' => fn (ChannelInterface $channel): array => [ 'label' => $channel->getName(), 'currency' => $channel->getBaseCurrency()->getCode(), ], diff --git a/src/Sylius/Bundle/CoreBundle/Form/Type/Shipping/Calculator/ChannelBasedPerUnitRateConfigurationType.php b/src/Sylius/Bundle/CoreBundle/Form/Type/Shipping/Calculator/ChannelBasedPerUnitRateConfigurationType.php index 6f904793e78..c659991007d 100644 --- a/src/Sylius/Bundle/CoreBundle/Form/Type/Shipping/Calculator/ChannelBasedPerUnitRateConfigurationType.php +++ b/src/Sylius/Bundle/CoreBundle/Form/Type/Shipping/Calculator/ChannelBasedPerUnitRateConfigurationType.php @@ -25,7 +25,7 @@ public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'entry_type' => PerUnitRateConfigurationType::class, - 'entry_options' => fn(ChannelInterface $channel): array => [ + 'entry_options' => fn (ChannelInterface $channel): array => [ 'label' => $channel->getName(), 'currency' => $channel->getBaseCurrency()->getCode(), ], diff --git a/src/Sylius/Bundle/CoreBundle/Form/Type/Shipping/Rule/ChannelBasedOrderTotalGreaterThanOrEqualConfigurationType.php b/src/Sylius/Bundle/CoreBundle/Form/Type/Shipping/Rule/ChannelBasedOrderTotalGreaterThanOrEqualConfigurationType.php index 99853ce87f8..2f074c796a1 100644 --- a/src/Sylius/Bundle/CoreBundle/Form/Type/Shipping/Rule/ChannelBasedOrderTotalGreaterThanOrEqualConfigurationType.php +++ b/src/Sylius/Bundle/CoreBundle/Form/Type/Shipping/Rule/ChannelBasedOrderTotalGreaterThanOrEqualConfigurationType.php @@ -24,7 +24,7 @@ public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'entry_type' => OrderTotalGreaterThanOrEqualConfigurationType::class, - 'entry_options' => fn(ChannelInterface $channel): array => [ + 'entry_options' => fn (ChannelInterface $channel): array => [ 'label' => $channel->getName(), 'currency' => $channel->getBaseCurrency()->getCode(), ], diff --git a/src/Sylius/Bundle/CoreBundle/Form/Type/Shipping/Rule/ChannelBasedOrderTotalLessThanOrEqualConfigurationType.php b/src/Sylius/Bundle/CoreBundle/Form/Type/Shipping/Rule/ChannelBasedOrderTotalLessThanOrEqualConfigurationType.php index fc622b8ed4f..f27a13ffbe3 100644 --- a/src/Sylius/Bundle/CoreBundle/Form/Type/Shipping/Rule/ChannelBasedOrderTotalLessThanOrEqualConfigurationType.php +++ b/src/Sylius/Bundle/CoreBundle/Form/Type/Shipping/Rule/ChannelBasedOrderTotalLessThanOrEqualConfigurationType.php @@ -24,7 +24,7 @@ public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'entry_type' => OrderTotalLessThanOrEqualConfigurationType::class, - 'entry_options' => fn(ChannelInterface $channel): array => [ + 'entry_options' => fn (ChannelInterface $channel): array => [ 'label' => $channel->getName(), 'currency' => $channel->getBaseCurrency()->getCode(), ], diff --git a/src/Sylius/Bundle/CoreBundle/Migrations/Version20220210135918.php b/src/Sylius/Bundle/CoreBundle/Migrations/Version20220210135918.php index 8afe1a3ed4a..5163c55f1c7 100644 --- a/src/Sylius/Bundle/CoreBundle/Migrations/Version20220210135918.php +++ b/src/Sylius/Bundle/CoreBundle/Migrations/Version20220210135918.php @@ -1,5 +1,14 @@ setDefaults([ - 'choices' => fn(Options $options): array => $this->currencyRepository->findAll(), + 'choices' => fn (Options $options): array => $this->currencyRepository->findAll(), 'choice_value' => 'code', 'choice_label' => 'name', 'choice_translation_domain' => false, diff --git a/src/Sylius/Bundle/CurrencyBundle/test/src/Tests/SyliusCurrencyBundleTest.php b/src/Sylius/Bundle/CurrencyBundle/test/src/Tests/SyliusCurrencyBundleTest.php index 060aefd1e22..6ece2595809 100644 --- a/src/Sylius/Bundle/CurrencyBundle/test/src/Tests/SyliusCurrencyBundleTest.php +++ b/src/Sylius/Bundle/CurrencyBundle/test/src/Tests/SyliusCurrencyBundleTest.php @@ -30,7 +30,7 @@ public function its_services_are_initializable(): void $services = $container->getServiceIds(); - $services = array_filter($services, fn(string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); + $services = array_filter($services, fn (string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); foreach ($services as $id) { Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); diff --git a/src/Sylius/Bundle/CustomerBundle/Form/Type/CustomerChoiceType.php b/src/Sylius/Bundle/CustomerBundle/Form/Type/CustomerChoiceType.php index 4ca9e4cd7bf..d5b4706d872 100644 --- a/src/Sylius/Bundle/CustomerBundle/Form/Type/CustomerChoiceType.php +++ b/src/Sylius/Bundle/CustomerBundle/Form/Type/CustomerChoiceType.php @@ -38,9 +38,9 @@ public function buildForm(FormBuilderInterface $builder, array $options): void public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ - 'choices' => fn(Options $options): array => $this->customerRepository->findAll(), + 'choices' => fn (Options $options): array => $this->customerRepository->findAll(), 'choice_value' => 'email', - 'choice_label' => fn(CustomerInterface $customer): string => sprintf('%s (%s)', $customer->getFullName(), $customer->getEmail()), + 'choice_label' => fn (CustomerInterface $customer): string => sprintf('%s (%s)', $customer->getFullName(), $customer->getEmail()), 'choice_translation_domain' => false, ]); } diff --git a/src/Sylius/Bundle/CustomerBundle/Form/Type/CustomerGroupChoiceType.php b/src/Sylius/Bundle/CustomerBundle/Form/Type/CustomerGroupChoiceType.php index 4c45150a696..cde38364216 100644 --- a/src/Sylius/Bundle/CustomerBundle/Form/Type/CustomerGroupChoiceType.php +++ b/src/Sylius/Bundle/CustomerBundle/Form/Type/CustomerGroupChoiceType.php @@ -37,7 +37,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ - 'choices' => fn(Options $options): array => $this->customerGroupRepository->findAll(), + 'choices' => fn (Options $options): array => $this->customerGroupRepository->findAll(), 'choice_value' => 'code', 'choice_label' => 'name', 'choice_translation_domain' => false, diff --git a/src/Sylius/Bundle/CustomerBundle/test/src/Tests/SyliusCustomerBundleTest.php b/src/Sylius/Bundle/CustomerBundle/test/src/Tests/SyliusCustomerBundleTest.php index 9b7b3cb8767..351c4d25b62 100644 --- a/src/Sylius/Bundle/CustomerBundle/test/src/Tests/SyliusCustomerBundleTest.php +++ b/src/Sylius/Bundle/CustomerBundle/test/src/Tests/SyliusCustomerBundleTest.php @@ -30,7 +30,7 @@ public function its_services_are_initializable(): void $services = $container->getServiceIds(); - $services = array_filter($services, fn(string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); + $services = array_filter($services, fn (string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); foreach ($services as $id) { Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); diff --git a/src/Sylius/Bundle/InventoryBundle/test/src/Tests/SyliusInventoryBundleTest.php b/src/Sylius/Bundle/InventoryBundle/test/src/Tests/SyliusInventoryBundleTest.php index 2875d52c9cc..d11f5c32009 100644 --- a/src/Sylius/Bundle/InventoryBundle/test/src/Tests/SyliusInventoryBundleTest.php +++ b/src/Sylius/Bundle/InventoryBundle/test/src/Tests/SyliusInventoryBundleTest.php @@ -30,7 +30,7 @@ public function its_services_are_initializable(): void $services = $container->getServiceIds(); - $services = array_filter($services, fn(string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); + $services = array_filter($services, fn (string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); foreach ($services as $id) { Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); diff --git a/src/Sylius/Bundle/LocaleBundle/test/src/Tests/SyliusLocaleBundleTest.php b/src/Sylius/Bundle/LocaleBundle/test/src/Tests/SyliusLocaleBundleTest.php index 530dc17fe9a..8ba76f655a4 100644 --- a/src/Sylius/Bundle/LocaleBundle/test/src/Tests/SyliusLocaleBundleTest.php +++ b/src/Sylius/Bundle/LocaleBundle/test/src/Tests/SyliusLocaleBundleTest.php @@ -30,7 +30,7 @@ public function its_services_are_initializable(): void $services = $container->getServiceIds(); - $services = array_filter($services, fn(string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); + $services = array_filter($services, fn (string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); foreach ($services as $id) { Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); diff --git a/src/Sylius/Bundle/MoneyBundle/test/src/Tests/SyliusMoneyBundleTest.php b/src/Sylius/Bundle/MoneyBundle/test/src/Tests/SyliusMoneyBundleTest.php index db501285211..97c8639a06c 100644 --- a/src/Sylius/Bundle/MoneyBundle/test/src/Tests/SyliusMoneyBundleTest.php +++ b/src/Sylius/Bundle/MoneyBundle/test/src/Tests/SyliusMoneyBundleTest.php @@ -30,7 +30,7 @@ public function its_services_are_initializable(): void $services = $container->getServiceIds(); - $services = array_filter($services, fn(string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); + $services = array_filter($services, fn (string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); foreach ($services as $id) { Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); diff --git a/src/Sylius/Bundle/OrderBundle/test/src/Tests/SyliusOrderBundleTest.php b/src/Sylius/Bundle/OrderBundle/test/src/Tests/SyliusOrderBundleTest.php index fa8193606f8..1b834994b07 100644 --- a/src/Sylius/Bundle/OrderBundle/test/src/Tests/SyliusOrderBundleTest.php +++ b/src/Sylius/Bundle/OrderBundle/test/src/Tests/SyliusOrderBundleTest.php @@ -30,7 +30,7 @@ public function its_services_are_initializable(): void $services = $container->getServiceIds(); - $services = array_filter($services, fn(string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); + $services = array_filter($services, fn (string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); foreach ($services as $id) { Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); diff --git a/src/Sylius/Bundle/PaymentBundle/test/src/Tests/SyliusPaymentBundleTest.php b/src/Sylius/Bundle/PaymentBundle/test/src/Tests/SyliusPaymentBundleTest.php index a9831cc2d89..2f1b356758d 100644 --- a/src/Sylius/Bundle/PaymentBundle/test/src/Tests/SyliusPaymentBundleTest.php +++ b/src/Sylius/Bundle/PaymentBundle/test/src/Tests/SyliusPaymentBundleTest.php @@ -30,7 +30,7 @@ public function its_services_are_initializable(): void $services = $container->getServiceIds(); - $services = array_filter($services, fn(string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); + $services = array_filter($services, fn (string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); foreach ($services as $id) { Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); diff --git a/src/Sylius/Bundle/PayumBundle/DependencyInjection/Compiler/InjectContainerIntoControllersPass.php b/src/Sylius/Bundle/PayumBundle/DependencyInjection/Compiler/InjectContainerIntoControllersPass.php index 9dfb6e3a45a..ef78e11504e 100644 --- a/src/Sylius/Bundle/PayumBundle/DependencyInjection/Compiler/InjectContainerIntoControllersPass.php +++ b/src/Sylius/Bundle/PayumBundle/DependencyInjection/Compiler/InjectContainerIntoControllersPass.php @@ -20,7 +20,6 @@ use Payum\Bundle\PayumBundle\Controller\PayoutController; use Payum\Bundle\PayumBundle\Controller\RefundController; use Payum\Bundle\PayumBundle\Controller\SyncController; -use Payum\Bundle\PayumBundle\Controller; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; diff --git a/src/Sylius/Bundle/PayumBundle/DependencyInjection/Compiler/RegisterGatewayConfigTypePass.php b/src/Sylius/Bundle/PayumBundle/DependencyInjection/Compiler/RegisterGatewayConfigTypePass.php index 82e618c8529..8e558c553c9 100644 --- a/src/Sylius/Bundle/PayumBundle/DependencyInjection/Compiler/RegisterGatewayConfigTypePass.php +++ b/src/Sylius/Bundle/PayumBundle/DependencyInjection/Compiler/RegisterGatewayConfigTypePass.php @@ -48,7 +48,7 @@ public function process(ContainerBuilder $container): void } } - usort($gatewayFactories, fn(array $firstGateway, array $secondGateway): int => $secondGateway['priority'] - $firstGateway['priority']); + usort($gatewayFactories, fn (array $firstGateway, array $secondGateway): int => $secondGateway['priority'] - $firstGateway['priority']); $sortedGatewayFactories = []; foreach ($gatewayFactories as $key => $factory) { diff --git a/src/Sylius/Bundle/PayumBundle/Model/PaymentSecurityToken.php b/src/Sylius/Bundle/PayumBundle/Model/PaymentSecurityToken.php index 32487c67750..f6fca45c013 100644 --- a/src/Sylius/Bundle/PayumBundle/Model/PaymentSecurityToken.php +++ b/src/Sylius/Bundle/PayumBundle/Model/PaymentSecurityToken.php @@ -21,16 +21,16 @@ class PaymentSecurityToken implements PaymentSecurityTokenInterface protected $hash; /** @var object|null */ - protected $details = null; + protected $details; /** @var string|null */ - protected $afterUrl = null; + protected $afterUrl; /** @var string|null */ - protected $targetUrl = null; + protected $targetUrl; /** @var string|null */ - protected $gatewayName = null; + protected $gatewayName; public function __construct() { diff --git a/src/Sylius/Bundle/ProductBundle/Form/DataTransformer/ProductVariantToProductOptionsTransformer.php b/src/Sylius/Bundle/ProductBundle/Form/DataTransformer/ProductVariantToProductOptionsTransformer.php index 824aec22188..e6a6a2f0e38 100644 --- a/src/Sylius/Bundle/ProductBundle/Form/DataTransformer/ProductVariantToProductOptionsTransformer.php +++ b/src/Sylius/Bundle/ProductBundle/Form/DataTransformer/ProductVariantToProductOptionsTransformer.php @@ -41,7 +41,7 @@ public function transform($value): array return array_combine( array_map( - fn(ProductOptionValueInterface $productOptionValue): string => (string) $productOptionValue->getOptionCode(), + fn (ProductOptionValueInterface $productOptionValue): string => (string) $productOptionValue->getOptionCode(), $value->getOptionValues()->toArray() ), $value->getOptionValues()->toArray() diff --git a/src/Sylius/Bundle/ProductBundle/Form/EventSubscriber/BuildAttributesFormSubscriber.php b/src/Sylius/Bundle/ProductBundle/Form/EventSubscriber/BuildAttributesFormSubscriber.php index fb0ca39d131..7d067d89d61 100644 --- a/src/Sylius/Bundle/ProductBundle/Form/EventSubscriber/BuildAttributesFormSubscriber.php +++ b/src/Sylius/Bundle/ProductBundle/Form/EventSubscriber/BuildAttributesFormSubscriber.php @@ -53,7 +53,7 @@ public function preSetData(FormEvent $event): void $defaultLocaleCode = $this->localeProvider->getDefaultLocaleCode(); $attributes = $product->getAttributes()->filter( - fn(ProductAttributeValueInterface $attribute) => $attribute->getLocaleCode() === $defaultLocaleCode + fn (ProductAttributeValueInterface $attribute) => $attribute->getLocaleCode() === $defaultLocaleCode ); /** @var ProductAttributeValueInterface $attribute */ diff --git a/src/Sylius/Bundle/ProductBundle/Form/Type/ProductAssociationTypeChoiceType.php b/src/Sylius/Bundle/ProductBundle/Form/Type/ProductAssociationTypeChoiceType.php index d83e27de82d..25f74e4fc29 100644 --- a/src/Sylius/Bundle/ProductBundle/Form/Type/ProductAssociationTypeChoiceType.php +++ b/src/Sylius/Bundle/ProductBundle/Form/Type/ProductAssociationTypeChoiceType.php @@ -37,7 +37,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ - 'choices' => fn(Options $options) => $this->productAssociationTypeRepository->findAll(), + 'choices' => fn (Options $options) => $this->productAssociationTypeRepository->findAll(), 'choice_value' => 'code', 'choice_label' => 'name', 'choice_translation_domain' => false, diff --git a/src/Sylius/Bundle/ProductBundle/Form/Type/ProductAssociationsType.php b/src/Sylius/Bundle/ProductBundle/Form/Type/ProductAssociationsType.php index fa4418b4ecd..fb671e3186d 100644 --- a/src/Sylius/Bundle/ProductBundle/Form/Type/ProductAssociationsType.php +++ b/src/Sylius/Bundle/ProductBundle/Form/Type/ProductAssociationsType.php @@ -40,8 +40,8 @@ public function configureOptions(OptionsResolver $resolver): void $resolver->setDefaults([ 'entries' => $this->productAssociationTypeRepository->findAll(), 'entry_type' => TextType::class, - 'entry_name' => fn(ProductAssociationTypeInterface $productAssociationType) => $productAssociationType->getCode(), - 'entry_options' => fn(ProductAssociationTypeInterface $productAssociationType) => [ + 'entry_name' => fn (ProductAssociationTypeInterface $productAssociationType) => $productAssociationType->getCode(), + 'entry_options' => fn (ProductAssociationTypeInterface $productAssociationType) => [ 'label' => $productAssociationType->getName(), ], ]); diff --git a/src/Sylius/Bundle/ProductBundle/Form/Type/ProductChoiceType.php b/src/Sylius/Bundle/ProductBundle/Form/Type/ProductChoiceType.php index 4043770f92c..2c0e92a85c3 100644 --- a/src/Sylius/Bundle/ProductBundle/Form/Type/ProductChoiceType.php +++ b/src/Sylius/Bundle/ProductBundle/Form/Type/ProductChoiceType.php @@ -37,7 +37,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ - 'choices' => fn(Options $options) => $this->productRepository->findAll(), + 'choices' => fn (Options $options) => $this->productRepository->findAll(), 'choice_value' => 'code', 'choice_label' => 'name', 'choice_translation_domain' => false, diff --git a/src/Sylius/Bundle/ProductBundle/Form/Type/ProductOptionChoiceType.php b/src/Sylius/Bundle/ProductBundle/Form/Type/ProductOptionChoiceType.php index 7392f2d2eeb..7620db8741c 100644 --- a/src/Sylius/Bundle/ProductBundle/Form/Type/ProductOptionChoiceType.php +++ b/src/Sylius/Bundle/ProductBundle/Form/Type/ProductOptionChoiceType.php @@ -37,7 +37,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ - 'choices' => fn(Options $options): array => $this->productOptionRepository->findAll(), + 'choices' => fn (Options $options): array => $this->productOptionRepository->findAll(), 'choice_value' => 'code', 'choice_label' => 'name', 'choice_translation_domain' => false, diff --git a/src/Sylius/Bundle/ProductBundle/Form/Type/ProductVariantChoiceType.php b/src/Sylius/Bundle/ProductBundle/Form/Type/ProductVariantChoiceType.php index ee7ff0a117c..a22cf283477 100644 --- a/src/Sylius/Bundle/ProductBundle/Form/Type/ProductVariantChoiceType.php +++ b/src/Sylius/Bundle/ProductBundle/Form/Type/ProductVariantChoiceType.php @@ -35,9 +35,9 @@ public function configureOptions(OptionsResolver $resolver): void { $resolver ->setDefaults([ - 'choices' => fn(Options $options): iterable => $options['product']->getVariants(), + 'choices' => fn (Options $options): iterable => $options['product']->getVariants(), 'choice_value' => 'code', - 'choice_label' => fn(ProductVariantInterface $variant): string => $variant->getName(), + 'choice_label' => fn (ProductVariantInterface $variant): string => $variant->getName(), 'choice_translation_domain' => false, 'multiple' => false, 'expanded' => true, diff --git a/src/Sylius/Bundle/ProductBundle/Form/Type/ProductVariantMatchType.php b/src/Sylius/Bundle/ProductBundle/Form/Type/ProductVariantMatchType.php index 4cb3fff17dd..1ab978aa004 100644 --- a/src/Sylius/Bundle/ProductBundle/Form/Type/ProductVariantMatchType.php +++ b/src/Sylius/Bundle/ProductBundle/Form/Type/ProductVariantMatchType.php @@ -40,8 +40,8 @@ public function configureOptions(OptionsResolver $resolver): void return $product->getOptions(); }, 'entry_type' => ProductOptionValueChoiceType::class, - 'entry_name' => fn(ProductOptionInterface $productOption) => $productOption->getCode(), - 'entry_options' => fn(Options $options) => fn(ProductOptionInterface $productOption) => [ + 'entry_name' => fn (ProductOptionInterface $productOption) => $productOption->getCode(), + 'entry_options' => fn (Options $options) => fn (ProductOptionInterface $productOption) => [ 'label' => $productOption->getName(), 'option' => $productOption, 'only_available_values' => true, diff --git a/src/Sylius/Bundle/ProductBundle/test/src/Tests/SyliusProductBundleTest.php b/src/Sylius/Bundle/ProductBundle/test/src/Tests/SyliusProductBundleTest.php index fd413d7fa3f..ff3c83f54b1 100644 --- a/src/Sylius/Bundle/ProductBundle/test/src/Tests/SyliusProductBundleTest.php +++ b/src/Sylius/Bundle/ProductBundle/test/src/Tests/SyliusProductBundleTest.php @@ -30,7 +30,7 @@ public function its_services_are_initializable(): void $services = $container->getServiceIds(); - $services = array_filter($services, fn(string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); + $services = array_filter($services, fn (string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); foreach ($services as $id) { Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); diff --git a/src/Sylius/Bundle/PromotionBundle/DependencyInjection/Compiler/CompositePromotionCouponEligibilityCheckerPass.php b/src/Sylius/Bundle/PromotionBundle/DependencyInjection/Compiler/CompositePromotionCouponEligibilityCheckerPass.php index 93a4ff81f24..b502cc50f13 100644 --- a/src/Sylius/Bundle/PromotionBundle/DependencyInjection/Compiler/CompositePromotionCouponEligibilityCheckerPass.php +++ b/src/Sylius/Bundle/PromotionBundle/DependencyInjection/Compiler/CompositePromotionCouponEligibilityCheckerPass.php @@ -27,7 +27,7 @@ public function process(ContainerBuilder $container): void $container->getDefinition('sylius.promotion_coupon_eligibility_checker')->setArguments([ array_map( - fn($id) => new Reference($id), + fn ($id) => new Reference($id), array_keys($container->findTaggedServiceIds('sylius.promotion_coupon_eligibility_checker')) ), ]); diff --git a/src/Sylius/Bundle/PromotionBundle/DependencyInjection/Compiler/CompositePromotionEligibilityCheckerPass.php b/src/Sylius/Bundle/PromotionBundle/DependencyInjection/Compiler/CompositePromotionEligibilityCheckerPass.php index fb8212e5043..8698c379b27 100644 --- a/src/Sylius/Bundle/PromotionBundle/DependencyInjection/Compiler/CompositePromotionEligibilityCheckerPass.php +++ b/src/Sylius/Bundle/PromotionBundle/DependencyInjection/Compiler/CompositePromotionEligibilityCheckerPass.php @@ -27,7 +27,7 @@ public function process(ContainerBuilder $container): void $container->getDefinition('sylius.promotion_eligibility_checker')->setArguments([ array_map( - fn($id) => new Reference($id), + fn ($id) => new Reference($id), array_keys($container->findTaggedServiceIds('sylius.promotion_eligibility_checker')) ), ]); diff --git a/src/Sylius/Bundle/PromotionBundle/Tests/Command/GenerateCouponsCommandTest.php b/src/Sylius/Bundle/PromotionBundle/Tests/Command/GenerateCouponsCommandTest.php index 50ff1f31ecc..162b4f0ce73 100644 --- a/src/Sylius/Bundle/PromotionBundle/Tests/Command/GenerateCouponsCommandTest.php +++ b/src/Sylius/Bundle/PromotionBundle/Tests/Command/GenerateCouponsCommandTest.php @@ -13,15 +13,14 @@ namespace Sylius\Bundle\PromotionBundle\Tests\Command; -use Symfony\Component\Console\Command\Command; use InvalidArgumentException; -use Sylius\Bundle\PromotionBundle\Command\GenerateCouponsCommand; use Sylius\Component\Promotion\Generator\PromotionCouponGeneratorInstruction; use Sylius\Component\Promotion\Generator\PromotionCouponGeneratorInterface; use Sylius\Component\Promotion\Model\PromotionInterface; use Sylius\Component\Promotion\Repository\PromotionRepositoryInterface; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; +use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Tester\CommandTester; class GenerateCouponsCommandTest extends KernelTestCase diff --git a/src/Sylius/Bundle/PromotionBundle/test/src/Tests/SyliusPromotionBundleTest.php b/src/Sylius/Bundle/PromotionBundle/test/src/Tests/SyliusPromotionBundleTest.php index 914cbb6a98a..37c8770067f 100644 --- a/src/Sylius/Bundle/PromotionBundle/test/src/Tests/SyliusPromotionBundleTest.php +++ b/src/Sylius/Bundle/PromotionBundle/test/src/Tests/SyliusPromotionBundleTest.php @@ -30,7 +30,7 @@ public function its_services_are_initializable(): void $services = $container->getServiceIds(); - $services = array_filter($services, fn(string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); + $services = array_filter($services, fn (string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); foreach ($services as $id) { Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); diff --git a/src/Sylius/Bundle/ReviewBundle/test/src/Tests/SyliusReviewBundleTest.php b/src/Sylius/Bundle/ReviewBundle/test/src/Tests/SyliusReviewBundleTest.php index 8418fb71243..645d7e116ed 100644 --- a/src/Sylius/Bundle/ReviewBundle/test/src/Tests/SyliusReviewBundleTest.php +++ b/src/Sylius/Bundle/ReviewBundle/test/src/Tests/SyliusReviewBundleTest.php @@ -30,7 +30,7 @@ public function its_services_are_initializable(): void $services = $container->getServiceIds(); - $services = array_filter($services, fn(string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); + $services = array_filter($services, fn (string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); foreach ($services as $id) { Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); diff --git a/src/Sylius/Bundle/ShippingBundle/DependencyInjection/Compiler/CompositeShippingMethodEligibilityCheckerPass.php b/src/Sylius/Bundle/ShippingBundle/DependencyInjection/Compiler/CompositeShippingMethodEligibilityCheckerPass.php index 5df596a4acb..c135da86395 100644 --- a/src/Sylius/Bundle/ShippingBundle/DependencyInjection/Compiler/CompositeShippingMethodEligibilityCheckerPass.php +++ b/src/Sylius/Bundle/ShippingBundle/DependencyInjection/Compiler/CompositeShippingMethodEligibilityCheckerPass.php @@ -27,7 +27,7 @@ public function process(ContainerBuilder $container): void $container->getDefinition('sylius.shipping_method_eligibility_checker')->setArguments([ array_map( - static fn($id): Reference => new Reference($id), + static fn ($id): Reference => new Reference($id), array_keys($container->findTaggedServiceIds('sylius.shipping_method_eligibility_checker')) ), ]); diff --git a/src/Sylius/Bundle/ShippingBundle/Form/Type/ShippingCategoryChoiceType.php b/src/Sylius/Bundle/ShippingBundle/Form/Type/ShippingCategoryChoiceType.php index cd649083fbb..b9f2b583084 100644 --- a/src/Sylius/Bundle/ShippingBundle/Form/Type/ShippingCategoryChoiceType.php +++ b/src/Sylius/Bundle/ShippingBundle/Form/Type/ShippingCategoryChoiceType.php @@ -37,7 +37,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ - 'choices' => fn(Options $options) => $this->shippingCategoryRepository->findAll(), + 'choices' => fn (Options $options) => $this->shippingCategoryRepository->findAll(), 'choice_value' => 'code', 'choice_label' => 'name', 'choice_translation_domain' => false, diff --git a/src/Sylius/Bundle/ShippingBundle/test/src/Tests/SyliusShippingBundleTest.php b/src/Sylius/Bundle/ShippingBundle/test/src/Tests/SyliusShippingBundleTest.php index 6ac9a481e88..fc81d72d56e 100644 --- a/src/Sylius/Bundle/ShippingBundle/test/src/Tests/SyliusShippingBundleTest.php +++ b/src/Sylius/Bundle/ShippingBundle/test/src/Tests/SyliusShippingBundleTest.php @@ -30,7 +30,7 @@ public function its_services_are_initializable(): void $services = $container->getServiceIds(); - $services = array_filter($services, fn(string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); + $services = array_filter($services, fn (string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); foreach ($services as $id) { Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); diff --git a/src/Sylius/Bundle/ShopBundle/Calculator/OrderItemsSubtotalCalculator.php b/src/Sylius/Bundle/ShopBundle/Calculator/OrderItemsSubtotalCalculator.php index bb0c92c2e3f..57129950a4d 100644 --- a/src/Sylius/Bundle/ShopBundle/Calculator/OrderItemsSubtotalCalculator.php +++ b/src/Sylius/Bundle/ShopBundle/Calculator/OrderItemsSubtotalCalculator.php @@ -22,7 +22,7 @@ public function getSubtotal(OrderInterface $order): int { return array_reduce( $order->getItems()->toArray(), - static fn(int $subtotal, OrderItemInterface $item): int => $subtotal + $item->getSubtotal(), + static fn (int $subtotal, OrderItemInterface $item): int => $subtotal + $item->getSubtotal(), 0 ); } diff --git a/src/Sylius/Bundle/ShopBundle/Controller/CurrencySwitchController.php b/src/Sylius/Bundle/ShopBundle/Controller/CurrencySwitchController.php index c1851bcc701..00ff4237f28 100644 --- a/src/Sylius/Bundle/ShopBundle/Controller/CurrencySwitchController.php +++ b/src/Sylius/Bundle/ShopBundle/Controller/CurrencySwitchController.php @@ -40,7 +40,7 @@ public function renderAction(): Response $channel = $this->channelContext->getChannel(); $availableCurrencies = array_map( - fn(CurrencyInterface $currency) => $currency->getCode(), + fn (CurrencyInterface $currency) => $currency->getCode(), $channel->getCurrencies()->toArray() ); diff --git a/src/Sylius/Bundle/ShopBundle/DependencyInjection/Configuration.php b/src/Sylius/Bundle/ShopBundle/DependencyInjection/Configuration.php index f788743cf21..1c7d6e0d204 100644 --- a/src/Sylius/Bundle/ShopBundle/DependencyInjection/Configuration.php +++ b/src/Sylius/Bundle/ShopBundle/DependencyInjection/Configuration.php @@ -40,7 +40,7 @@ public function getConfigTreeBuilder(): TreeBuilder ->validate() ->ifTrue( /** @param mixed $pattern */ - fn($pattern) => !is_string($pattern) + fn ($pattern) => !is_string($pattern) ) ->thenInvalid('Invalid pattern "%s"') ->end() diff --git a/src/Sylius/Bundle/ShopBundle/Twig/OrderTaxesTotalExtension.php b/src/Sylius/Bundle/ShopBundle/Twig/OrderTaxesTotalExtension.php index 555dc810719..f3431af316c 100644 --- a/src/Sylius/Bundle/ShopBundle/Twig/OrderTaxesTotalExtension.php +++ b/src/Sylius/Bundle/ShopBundle/Twig/OrderTaxesTotalExtension.php @@ -43,7 +43,7 @@ private function getAmount(OrderInterface $order, bool $isNeutral): int { return array_reduce( $order->getAdjustmentsRecursively(AdjustmentInterface::TAX_ADJUSTMENT)->toArray(), - static fn(int $total, BaseAdjustmentInterface $adjustment) => $isNeutral === $adjustment->isNeutral() ? $total + $adjustment->getAmount() : $total, + static fn (int $total, BaseAdjustmentInterface $adjustment) => $isNeutral === $adjustment->isNeutral() ? $total + $adjustment->getAmount() : $total, 0 ); } diff --git a/src/Sylius/Bundle/TaxationBundle/Form/Type/TaxCategoryChoiceType.php b/src/Sylius/Bundle/TaxationBundle/Form/Type/TaxCategoryChoiceType.php index 3f916ed42cf..c72d4ac1d47 100644 --- a/src/Sylius/Bundle/TaxationBundle/Form/Type/TaxCategoryChoiceType.php +++ b/src/Sylius/Bundle/TaxationBundle/Form/Type/TaxCategoryChoiceType.php @@ -37,7 +37,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ - 'choices' => fn(Options $options) => $this->taxCategoryRepository->findAll(), + 'choices' => fn (Options $options) => $this->taxCategoryRepository->findAll(), 'choice_value' => 'code', 'choice_label' => 'name', 'choice_translation_domain' => false, diff --git a/src/Sylius/Bundle/TaxationBundle/test/src/Tests/SyliusTaxationBundleTest.php b/src/Sylius/Bundle/TaxationBundle/test/src/Tests/SyliusTaxationBundleTest.php index 38ac014b2c4..b6425d0d148 100644 --- a/src/Sylius/Bundle/TaxationBundle/test/src/Tests/SyliusTaxationBundleTest.php +++ b/src/Sylius/Bundle/TaxationBundle/test/src/Tests/SyliusTaxationBundleTest.php @@ -30,7 +30,7 @@ public function its_services_are_initializable(): void $services = $container->getServiceIds(); - $services = array_filter($services, fn(string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); + $services = array_filter($services, fn (string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); foreach ($services as $id) { Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); diff --git a/src/Sylius/Bundle/TaxonomyBundle/Tests/Functional/SyliusTaxonomyBundleTest.php b/src/Sylius/Bundle/TaxonomyBundle/Tests/Functional/SyliusTaxonomyBundleTest.php index 1a3aa77436b..2bc706b473c 100644 --- a/src/Sylius/Bundle/TaxonomyBundle/Tests/Functional/SyliusTaxonomyBundleTest.php +++ b/src/Sylius/Bundle/TaxonomyBundle/Tests/Functional/SyliusTaxonomyBundleTest.php @@ -30,7 +30,7 @@ public function its_services_are_initializable() /** @var Container $container */ $container = self::$kernel->getContainer(); - $serviceIds = array_filter($container->getServiceIds(), fn(string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); + $serviceIds = array_filter($container->getServiceIds(), fn (string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); foreach ($serviceIds as $id) { Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); diff --git a/src/Sylius/Bundle/UiBundle/Command/DebugTemplateEventCommand.php b/src/Sylius/Bundle/UiBundle/Command/DebugTemplateEventCommand.php index 3dd3651ab14..25a1aaab552 100644 --- a/src/Sylius/Bundle/UiBundle/Command/DebugTemplateEventCommand.php +++ b/src/Sylius/Bundle/UiBundle/Command/DebugTemplateEventCommand.php @@ -59,7 +59,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int $io->table( ['Block name', 'Template', 'Priority', 'Enabled'], array_map( - static fn(TemplateBlock $templateBlock): array => [ + static fn (TemplateBlock $templateBlock): array => [ $templateBlock->getName(), $templateBlock->getTemplate(), $templateBlock->getPriority(), diff --git a/src/Sylius/Bundle/UiBundle/DataCollector/TemplateBlockDataCollector.php b/src/Sylius/Bundle/UiBundle/DataCollector/TemplateBlockDataCollector.php index 5d4be85122f..212a32841a4 100644 --- a/src/Sylius/Bundle/UiBundle/DataCollector/TemplateBlockDataCollector.php +++ b/src/Sylius/Bundle/UiBundle/DataCollector/TemplateBlockDataCollector.php @@ -45,12 +45,12 @@ public function getNumberOfRenderedEvents(): int public function getNumberOfRenderedBlocks(): int { - return array_reduce($this->data['renderedEvents'], static fn(int $accumulator, array $event): int => $accumulator + count($event['blocks']), 0); + return array_reduce($this->data['renderedEvents'], static fn (int $accumulator, array $event): int => $accumulator + count($event['blocks']), 0); } public function getTotalDuration(): float { - return array_reduce($this->data['renderedEvents'], static fn(float $accumulator, array $event): float => $accumulator + $event['time'], 0.0); + return array_reduce($this->data['renderedEvents'], static fn (float $accumulator, array $event): float => $accumulator + $event['time'], 0.0); } public function getName(): string diff --git a/src/Sylius/Bundle/UiBundle/DependencyInjection/Configuration.php b/src/Sylius/Bundle/UiBundle/DependencyInjection/Configuration.php index ffb17b4f38f..7b3bd10b678 100644 --- a/src/Sylius/Bundle/UiBundle/DependencyInjection/Configuration.php +++ b/src/Sylius/Bundle/UiBundle/DependencyInjection/Configuration.php @@ -40,7 +40,7 @@ public function getConfigTreeBuilder(): TreeBuilder ->canBeDisabled() ->beforeNormalization() ->ifString() - ->then(static fn(?string $template): array => ['template' => $template]) + ->then(static fn (?string $template): array => ['template' => $template]) ->end() ->children() ->booleanNode('enabled')->defaultNull()->end() diff --git a/src/Sylius/Bundle/UiBundle/Registry/TemplateBlockRegistry.php b/src/Sylius/Bundle/UiBundle/Registry/TemplateBlockRegistry.php index 6efda450bf1..f6384101f3d 100644 --- a/src/Sylius/Bundle/UiBundle/Registry/TemplateBlockRegistry.php +++ b/src/Sylius/Bundle/UiBundle/Registry/TemplateBlockRegistry.php @@ -46,13 +46,13 @@ public function findEnabledForEvents(array $eventNames): array return array_values(array_filter( $this->eventsToTemplateBlocks[$eventName] ?? [], - static fn(TemplateBlock $templateBlock): bool => $templateBlock->isEnabled() + static fn (TemplateBlock $templateBlock): bool => $templateBlock->isEnabled() )); } $enabledFinalizedTemplateBlocks = array_filter( $this->findFinalizedForEvents($eventNames), - static fn(TemplateBlock $templateBlock): bool => $templateBlock->isEnabled() + static fn (TemplateBlock $templateBlock): bool => $templateBlock->isEnabled() ); $templateBlocksPriorityQueue = new SplPriorityQueue(); diff --git a/src/Sylius/Bundle/UiBundle/Renderer/HtmlDebugTemplateEventRenderer.php b/src/Sylius/Bundle/UiBundle/Renderer/HtmlDebugTemplateEventRenderer.php index 77d42c68090..76b550922db 100644 --- a/src/Sylius/Bundle/UiBundle/Renderer/HtmlDebugTemplateEventRenderer.php +++ b/src/Sylius/Bundle/UiBundle/Renderer/HtmlDebugTemplateEventRenderer.php @@ -57,6 +57,6 @@ public function render(array $eventNames, array $context = []): string */ private function shouldRenderHtmlDebug(array $templateBlocks): bool { - return count($templateBlocks) === 0 || count(array_filter($templateBlocks, static fn(TemplateBlock $templateBlock): bool => strrpos($templateBlock->getTemplate(), '.html.twig') !== false)) >= 1; + return count($templateBlocks) === 0 || count(array_filter($templateBlocks, static fn (TemplateBlock $templateBlock): bool => strrpos($templateBlock->getTemplate(), '.html.twig') !== false)) >= 1; } } diff --git a/src/Sylius/Bundle/UiBundle/Tests/Functional/Kernel.php b/src/Sylius/Bundle/UiBundle/Tests/Functional/Kernel.php index b375d19f456..d1aff353c2c 100644 --- a/src/Sylius/Bundle/UiBundle/Tests/Functional/Kernel.php +++ b/src/Sylius/Bundle/UiBundle/Tests/Functional/Kernel.php @@ -13,12 +13,12 @@ namespace Sylius\Bundle\UiBundle\Tests\Functional; -use Symfony\Bundle\FrameworkBundle\FrameworkBundle; -use Symfony\Bundle\SecurityBundle\SecurityBundle; -use Symfony\Bundle\TwigBundle\TwigBundle; use Sonata\BlockBundle\SonataBlockBundle; use Sylius\Bundle\UiBundle\SyliusUiBundle; +use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; +use Symfony\Bundle\SecurityBundle\SecurityBundle; +use Symfony\Bundle\TwigBundle\TwigBundle; use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Kernel as HttpKernel; diff --git a/src/Sylius/Bundle/UiBundle/Tests/Functional/TemplateEventTest.php b/src/Sylius/Bundle/UiBundle/Tests/Functional/TemplateEventTest.php index 6baa2659f3b..4f962342cc4 100644 --- a/src/Sylius/Bundle/UiBundle/Tests/Functional/TemplateEventTest.php +++ b/src/Sylius/Bundle/UiBundle/Tests/Functional/TemplateEventTest.php @@ -15,7 +15,6 @@ use PHPUnit\Framework\Assert; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; -use Twig\Environment; final class TemplateEventTest extends KernelTestCase { diff --git a/src/Sylius/Bundle/UiBundle/Twig/MergeRecursiveExtension.php b/src/Sylius/Bundle/UiBundle/Twig/MergeRecursiveExtension.php index a27feb63b3a..15b7cb7ccac 100644 --- a/src/Sylius/Bundle/UiBundle/Twig/MergeRecursiveExtension.php +++ b/src/Sylius/Bundle/UiBundle/Twig/MergeRecursiveExtension.php @@ -23,7 +23,7 @@ public function getFilters(): array return [ new TwigFilter( 'sylius_merge_recursive', - fn(array $firstArray, array $secondArray): array => array_merge_recursive($firstArray, $secondArray) + fn (array $firstArray, array $secondArray): array => array_merge_recursive($firstArray, $secondArray) ), ]; } diff --git a/src/Sylius/Bundle/UserBundle/Command/AbstractRoleCommand.php b/src/Sylius/Bundle/UserBundle/Command/AbstractRoleCommand.php index bd2028b85af..71f749ba58a 100644 --- a/src/Sylius/Bundle/UserBundle/Command/AbstractRoleCommand.php +++ b/src/Sylius/Bundle/UserBundle/Command/AbstractRoleCommand.php @@ -127,7 +127,7 @@ protected function getAvailableUserTypes(): array $config = $this->getContainer()->getParameter('sylius.user.users'); // Keep only users types which implement \Sylius\Component\User\Model\UserInterface - $userTypes = array_filter($config, fn(array $userTypeConfig): bool => isset($userTypeConfig['user']['classes']['model']) && is_a($userTypeConfig['user']['classes']['model'], UserInterface::class, true)); + $userTypes = array_filter($config, fn (array $userTypeConfig): bool => isset($userTypeConfig['user']['classes']['model']) && is_a($userTypeConfig['user']['classes']['model'], UserInterface::class, true)); return array_keys($userTypes); } diff --git a/src/Sylius/Bundle/UserBundle/Security/UserLogin.php b/src/Sylius/Bundle/UserBundle/Security/UserLogin.php index ed8cef59628..e060ea10bc2 100644 --- a/src/Sylius/Bundle/UserBundle/Security/UserLogin.php +++ b/src/Sylius/Bundle/UserBundle/Security/UserLogin.php @@ -62,7 +62,7 @@ protected function createToken(UserInterface $user, string $firewallName): Usern $user, null, $firewallName, - array_map(/** @param object|string $role */ static fn($role): string => (string) $role, $user->getRoles()) + array_map(/** @param object|string $role */ static fn ($role): string => (string) $role, $user->getRoles()) ); } } diff --git a/src/Sylius/Bundle/UserBundle/Tests/Functional/SyliusUserBundleTest.php b/src/Sylius/Bundle/UserBundle/Tests/Functional/SyliusUserBundleTest.php index 225ff094fe0..9ad37ea1f16 100644 --- a/src/Sylius/Bundle/UserBundle/Tests/Functional/SyliusUserBundleTest.php +++ b/src/Sylius/Bundle/UserBundle/Tests/Functional/SyliusUserBundleTest.php @@ -30,7 +30,7 @@ public function its_services_are_initializable() /** @var Container $container */ $container = self::$kernel->getContainer(); - $serviceIds = array_filter($container->getServiceIds(), fn(string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); + $serviceIds = array_filter($container->getServiceIds(), fn (string $serviceId): bool => str_starts_with($serviceId, 'sylius.')); foreach ($serviceIds as $id) { Assert::assertNotNull($container->get($id, ContainerInterface::NULL_ON_INVALID_REFERENCE)); diff --git a/src/Sylius/Bundle/UserBundle/spec/EventListener/PasswordUpdaterListenerSpec.php b/src/Sylius/Bundle/UserBundle/spec/EventListener/PasswordUpdaterListenerSpec.php index 6789bfe4021..275a5ec67e3 100644 --- a/src/Sylius/Bundle/UserBundle/spec/EventListener/PasswordUpdaterListenerSpec.php +++ b/src/Sylius/Bundle/UserBundle/spec/EventListener/PasswordUpdaterListenerSpec.php @@ -82,8 +82,7 @@ function it_updates_password_on_pre_update_doctrine_event( function it_updates_password_on_pre_persist_doctrine_event_for_user_interface_implementation_only( PasswordUpdaterInterface $passwordUpdater, LifecycleEventArgs $event - ): void - { + ): void { $event->getEntity()->willReturn('user'); $passwordUpdater->updatePassword(Argument::any())->shouldNotBeCalled(); diff --git a/src/Sylius/Bundle/UserBundle/spec/Provider/UsernameOrEmailProviderSpec.php b/src/Sylius/Bundle/UserBundle/spec/Provider/UsernameOrEmailProviderSpec.php index aa75484cf5b..904299e67c8 100644 --- a/src/Sylius/Bundle/UserBundle/spec/Provider/UsernameOrEmailProviderSpec.php +++ b/src/Sylius/Bundle/UserBundle/spec/Provider/UsernameOrEmailProviderSpec.php @@ -21,7 +21,6 @@ use Sylius\Component\User\Repository\UserRepositoryInterface; use Symfony\Component\Security\Core\Exception\RuntimeException; use Symfony\Component\Security\Core\Exception\UnsupportedUserException; -use Symfony\Component\Security\Core\Exception\UsernameNotFoundException; use Symfony\Component\Security\Core\User\UserInterface as CoreUserInterface; use Symfony\Component\Security\Core\User\UserProviderInterface; diff --git a/src/Sylius/Component/Addressing/Model/Address.php b/src/Sylius/Component/Addressing/Model/Address.php index b7d753ca03e..89d46c54284 100644 --- a/src/Sylius/Component/Addressing/Model/Address.php +++ b/src/Sylius/Component/Addressing/Model/Address.php @@ -22,54 +22,34 @@ class Address implements AddressInterface /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $firstName; - /** - * @var string|null - */ + /** @var string|null */ protected $lastName; - /** - * @var string|null - */ + /** @var string|null */ protected $phoneNumber; - /** - * @var string|null - */ + /** @var string|null */ protected $company; - /** - * @var string|null - */ + /** @var string|null */ protected $countryCode; - /** - * @var string|null - */ + /** @var string|null */ protected $provinceCode; - /** - * @var string|null - */ + /** @var string|null */ protected $provinceName; - /** - * @var string|null - */ + /** @var string|null */ protected $street; - /** - * @var string|null - */ + /** @var string|null */ protected $city; - /** - * @var string|null - */ + /** @var string|null */ protected $postcode; public function __construct() diff --git a/src/Sylius/Component/Addressing/Model/Country.php b/src/Sylius/Component/Addressing/Model/Country.php index adada06e3dc..3d2254c4ecc 100644 --- a/src/Sylius/Component/Addressing/Model/Country.php +++ b/src/Sylius/Component/Addressing/Model/Country.php @@ -27,6 +27,7 @@ class Country implements CountryInterface, \Stringable /** * Country code ISO 3166-1 alpha-2. + * * @var string|null */ protected $code; diff --git a/src/Sylius/Component/Addressing/Model/Province.php b/src/Sylius/Component/Addressing/Model/Province.php index 0d9eb49509d..917de8fdac4 100644 --- a/src/Sylius/Component/Addressing/Model/Province.php +++ b/src/Sylius/Component/Addressing/Model/Province.php @@ -18,24 +18,16 @@ class Province implements ProvinceInterface, \Stringable /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $code; - /** - * @var string|null - */ + /** @var string|null */ protected $name; - /** - * @var string|null - */ + /** @var string|null */ protected $abbreviation; - /** - * @var CountryInterface|null - */ + /** @var CountryInterface|null */ protected $country; public function __toString(): string diff --git a/src/Sylius/Component/Addressing/Model/Zone.php b/src/Sylius/Component/Addressing/Model/Zone.php index 7e45d6e7a03..f344b3a42eb 100644 --- a/src/Sylius/Component/Addressing/Model/Zone.php +++ b/src/Sylius/Component/Addressing/Model/Zone.php @@ -21,24 +21,16 @@ class Zone implements ZoneInterface, \Stringable /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $code; - /** - * @var string|null - */ + /** @var string|null */ protected $name; - /** - * @var string|null - */ + /** @var string|null */ protected $type; - /** - * @var string - */ + /** @var string */ protected $scope = Scope::ALL; /** diff --git a/src/Sylius/Component/Addressing/Model/ZoneMember.php b/src/Sylius/Component/Addressing/Model/ZoneMember.php index 970f745fc10..c43c16c077c 100644 --- a/src/Sylius/Component/Addressing/Model/ZoneMember.php +++ b/src/Sylius/Component/Addressing/Model/ZoneMember.php @@ -18,14 +18,10 @@ class ZoneMember implements ZoneMemberInterface /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $code; - /** - * @var ZoneInterface|null - */ + /** @var ZoneInterface|null */ protected $belongsTo; public function getId() diff --git a/src/Sylius/Component/Attribute/Model/Attribute.php b/src/Sylius/Component/Attribute/Model/Attribute.php index 24c542b23a6..514943046d3 100644 --- a/src/Sylius/Component/Attribute/Model/Attribute.php +++ b/src/Sylius/Component/Attribute/Model/Attribute.php @@ -29,34 +29,22 @@ class Attribute implements AttributeInterface, \Stringable /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $code; - /** - * @var string - */ + /** @var string */ protected $type = TextAttributeType::TYPE; - /** - * @var mixed[] - */ + /** @var mixed[] */ protected $configuration = []; - /** - * @var string|null - */ + /** @var string|null */ protected $storageType; - /** - * @var int|null - */ + /** @var int|null */ protected $position; - /** - * @var bool - */ + /** @var bool */ protected $translatable = true; public function __construct() diff --git a/src/Sylius/Component/Attribute/Model/AttributeTranslation.php b/src/Sylius/Component/Attribute/Model/AttributeTranslation.php index 28c7e41a3ac..ec56a8f785a 100644 --- a/src/Sylius/Component/Attribute/Model/AttributeTranslation.php +++ b/src/Sylius/Component/Attribute/Model/AttributeTranslation.php @@ -20,9 +20,7 @@ class AttributeTranslation extends AbstractTranslation implements AttributeTrans /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $name; public function getId() diff --git a/src/Sylius/Component/Attribute/Model/AttributeValue.php b/src/Sylius/Component/Attribute/Model/AttributeValue.php index dece87daac0..5928356a27f 100644 --- a/src/Sylius/Component/Attribute/Model/AttributeValue.php +++ b/src/Sylius/Component/Attribute/Model/AttributeValue.php @@ -18,54 +18,34 @@ class AttributeValue implements AttributeValueInterface /** @var mixed */ protected $id; - /** - * @var AttributeSubjectInterface|null - */ + /** @var AttributeSubjectInterface|null */ protected $subject; - /** - * @var AttributeInterface|null - */ + /** @var AttributeInterface|null */ protected $attribute; - /** - * @var string|null - */ + /** @var string|null */ protected $localeCode; - /** - * @var string|null - */ + /** @var string|null */ private $text; - /** - * @var bool|null - */ + /** @var bool|null */ private $boolean; - /** - * @var int|null - */ + /** @var int|null */ private $integer; - /** - * @var float|null - */ + /** @var float|null */ private $float; - /** - * @var \DateTimeInterface|null - */ + /** @var \DateTimeInterface|null */ private $datetime; - /** - * @var \DateTimeInterface|null - */ + /** @var \DateTimeInterface|null */ private $date; - /** - * @var mixed[]|null - */ + /** @var mixed[]|null */ private $json; public function getId() diff --git a/src/Sylius/Component/Channel/Context/CachedPerRequestChannelContext.php b/src/Sylius/Component/Channel/Context/CachedPerRequestChannelContext.php index c38941b33fa..81b1f7d23c6 100644 --- a/src/Sylius/Component/Channel/Context/CachedPerRequestChannelContext.php +++ b/src/Sylius/Component/Channel/Context/CachedPerRequestChannelContext.php @@ -14,7 +14,6 @@ namespace Sylius\Component\Channel\Context; use Sylius\Component\Channel\Model\ChannelInterface; -use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestStack; final class CachedPerRequestChannelContext implements ChannelContextInterface diff --git a/src/Sylius/Component/Channel/Model/Channel.php b/src/Sylius/Component/Channel/Model/Channel.php index 777cc3e61b8..a765c08f515 100644 --- a/src/Sylius/Component/Channel/Model/Channel.php +++ b/src/Sylius/Component/Channel/Model/Channel.php @@ -23,29 +23,19 @@ class Channel implements ChannelInterface, \Stringable /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $code; - /** - * @var string|null - */ + /** @var string|null */ protected $name; - /** - * @var string|null - */ + /** @var string|null */ protected $description; - /** - * @var string|null - */ + /** @var string|null */ protected $hostname; - /** - * @var string|null - */ + /** @var string|null */ protected $color; public function __construct() diff --git a/src/Sylius/Component/Core/Factory/ChannelFactory.php b/src/Sylius/Component/Core/Factory/ChannelFactory.php index 1c36e95ef90..44d04b2e82e 100644 --- a/src/Sylius/Component/Core/Factory/ChannelFactory.php +++ b/src/Sylius/Component/Core/Factory/ChannelFactory.php @@ -25,7 +25,7 @@ public function __construct(private FactoryInterface $decoratedFactory, private } /** - * {@inheritdoc} + * @inheritdoc */ public function createNew(): ChannelInterface { diff --git a/src/Sylius/Component/Core/Model/Adjustment.php b/src/Sylius/Component/Core/Model/Adjustment.php index 04e5f7f8d40..7ce5a03df18 100644 --- a/src/Sylius/Component/Core/Model/Adjustment.php +++ b/src/Sylius/Component/Core/Model/Adjustment.php @@ -17,9 +17,7 @@ class Adjustment extends BaseAdjustment implements AdjustmentInterface { - /** - * @var ShipmentInterface|null - */ + /** @var ShipmentInterface|null */ protected $shipment; public function getShipment(): ?ShipmentInterface diff --git a/src/Sylius/Component/Core/Model/AdminUser.php b/src/Sylius/Component/Core/Model/AdminUser.php index cf7f5a172c6..cfbe775b400 100644 --- a/src/Sylius/Component/Core/Model/AdminUser.php +++ b/src/Sylius/Component/Core/Model/AdminUser.php @@ -17,24 +17,16 @@ class AdminUser extends User implements AdminUserInterface { - /** - * @var string|null - */ + /** @var string|null */ protected $firstName; - /** - * @var string|null - */ + /** @var string|null */ protected $lastName; - /** - * @var string|null - */ + /** @var string|null */ protected $localeCode; - /** - * @var ImageInterface|null - */ + /** @var ImageInterface|null */ protected $avatar; public function __construct() diff --git a/src/Sylius/Component/Core/Model/AvatarImageInterface.php b/src/Sylius/Component/Core/Model/AvatarImageInterface.php index 40193b5e13c..bfc924fd526 100644 --- a/src/Sylius/Component/Core/Model/AvatarImageInterface.php +++ b/src/Sylius/Component/Core/Model/AvatarImageInterface.php @@ -3,7 +3,7 @@ /* * This file is part of the Sylius package. * - * (c) Pawel Jedrzejewski + * (c) Paweł Jędrzejewski * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Sylius/Component/Core/Model/Channel.php b/src/Sylius/Component/Core/Model/Channel.php index 10138cc4701..8d61bdb246b 100644 --- a/src/Sylius/Component/Core/Model/Channel.php +++ b/src/Sylius/Component/Core/Model/Channel.php @@ -23,24 +23,16 @@ class Channel extends BaseChannel implements ChannelInterface { - /** - * @var CurrencyInterface|null - */ + /** @var CurrencyInterface|null */ protected $baseCurrency; - /** - * @var LocaleInterface|null - */ + /** @var LocaleInterface|null */ protected $defaultLocale; - /** - * @var ZoneInterface|null - */ + /** @var ZoneInterface|null */ protected $defaultTaxZone; - /** - * @var string|null - */ + /** @var string|null */ protected $taxCalculationStrategy; /** @@ -64,44 +56,28 @@ class Channel extends BaseChannel implements ChannelInterface */ protected $countries; - /** - * @var string|null - */ + /** @var string|null */ protected $themeName; - /** - * @var string|null - */ + /** @var string|null */ protected $contactEmail; - /** - * @var string|null - */ + /** @var string|null */ protected $contactPhoneNumber; - /** - * @var bool - */ + /** @var bool */ protected $skippingShippingStepAllowed = false; - /** - * @var bool - */ + /** @var bool */ protected $skippingPaymentStepAllowed = false; - /** - * @var bool - */ + /** @var bool */ protected $accountVerificationRequired = true; - /** - * @var ShopBillingDataInterface|null - */ + /** @var ShopBillingDataInterface|null */ protected $shopBillingData; - /** - * @var TaxonInterface|null - */ + /** @var TaxonInterface|null */ protected $menuTaxon; public function __construct() diff --git a/src/Sylius/Component/Core/Model/ChannelPricing.php b/src/Sylius/Component/Core/Model/ChannelPricing.php index fe08c6845af..b23390d6049 100644 --- a/src/Sylius/Component/Core/Model/ChannelPricing.php +++ b/src/Sylius/Component/Core/Model/ChannelPricing.php @@ -19,26 +19,18 @@ class ChannelPricing implements ChannelPricingInterface, \Stringable { /** @var mixed */ - protected $id = null; + protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $channelCode; - /** - * @var ProductVariantInterface|null - */ + /** @var ProductVariantInterface|null */ protected $productVariant; - /** - * @var int|null - */ + /** @var int|null */ protected $price; - /** - * @var int|null - */ + /** @var int|null */ protected $originalPrice; /** diff --git a/src/Sylius/Component/Core/Model/Customer.php b/src/Sylius/Component/Core/Model/Customer.php index a60dadef3aa..cd510475e73 100644 --- a/src/Sylius/Component/Core/Model/Customer.php +++ b/src/Sylius/Component/Core/Model/Customer.php @@ -28,9 +28,7 @@ class Customer extends BaseCustomer implements CustomerInterface */ protected $orders; - /** - * @var AddressInterface|null - */ + /** @var AddressInterface|null */ protected $defaultAddress; /** @@ -40,9 +38,7 @@ class Customer extends BaseCustomer implements CustomerInterface */ protected $addresses; - /** - * @var ShopUserInterface|null - */ + /** @var ShopUserInterface|null */ protected $user; public function __construct() diff --git a/src/Sylius/Component/Core/Model/Image.php b/src/Sylius/Component/Core/Model/Image.php index 0ec557eae6c..b3cd589aa22 100644 --- a/src/Sylius/Component/Core/Model/Image.php +++ b/src/Sylius/Component/Core/Model/Image.php @@ -16,26 +16,18 @@ abstract class Image implements ImageInterface { /** @var mixed */ - protected $id = null; + protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $type; - /** - * @var \SplFileInfo|null - */ + /** @var \SplFileInfo|null */ protected $file; - /** - * @var string|null - */ + /** @var string|null */ protected $path; - /** - * @var object|null - */ + /** @var object|null */ protected $owner; public function getId() diff --git a/src/Sylius/Component/Core/Model/Order.php b/src/Sylius/Component/Core/Model/Order.php index 16631aa4d03..3f9a0cbe3a3 100644 --- a/src/Sylius/Component/Core/Model/Order.php +++ b/src/Sylius/Component/Core/Model/Order.php @@ -29,24 +29,16 @@ class Order extends BaseOrder implements OrderInterface { - /** - * @var CustomerInterface|null - */ + /** @var \Sylius\Component\Core\Model\CustomerInterface|null */ protected $customer; - /** - * @var ChannelInterface|null - */ + /** @var \Sylius\Component\Core\Model\ChannelInterface|null */ protected $channel; - /** - * @var AddressInterface|null - */ + /** @var AddressInterface|null */ protected $shippingAddress; - /** - * @var AddressInterface|null - */ + /** @var AddressInterface|null */ protected $billingAddress; /** @@ -63,34 +55,22 @@ class Order extends BaseOrder implements OrderInterface */ protected $shipments; - /** - * @var string|null - */ + /** @var string|null */ protected $currencyCode; - /** - * @var string|null - */ + /** @var string|null */ protected $localeCode; - /** - * @var BaseCouponInterface|null - */ + /** @var BaseCouponInterface|null */ protected $promotionCoupon; - /** - * @var string - */ + /** @var string */ protected $checkoutState = OrderCheckoutStates::STATE_CART; - /** - * @var string - */ + /** @var string */ protected $paymentState = OrderPaymentStates::STATE_CART; - /** - * @var string - */ + /** @var string */ protected $shippingState = OrderShippingStates::STATE_CART; /** @@ -100,14 +80,10 @@ class Order extends BaseOrder implements OrderInterface */ protected $promotions; - /** - * @var string|null - */ + /** @var string|null */ protected $tokenValue; - /** - * @var string|null - */ + /** @var string|null */ protected $customerIp; protected bool $createdByGuest = true; diff --git a/src/Sylius/Component/Core/Model/OrderItem.php b/src/Sylius/Component/Core/Model/OrderItem.php index 5f0bb31d3f6..c6b60cd63b4 100644 --- a/src/Sylius/Component/Core/Model/OrderItem.php +++ b/src/Sylius/Component/Core/Model/OrderItem.php @@ -19,24 +19,16 @@ class OrderItem extends BaseOrderItem implements OrderItemInterface { - /** - * @var int - */ + /** @var int */ protected $version = 1; - /** - * @var ProductVariantInterface|null - */ + /** @var ProductVariantInterface|null */ protected $variant; - /** - * @var string|null - */ + /** @var string|null */ protected $productName; - /** - * @var string|null - */ + /** @var string|null */ protected $variantName; public function getVersion(): ?int diff --git a/src/Sylius/Component/Core/Model/OrderSequence.php b/src/Sylius/Component/Core/Model/OrderSequence.php index eadcd336369..6b648e03804 100644 --- a/src/Sylius/Component/Core/Model/OrderSequence.php +++ b/src/Sylius/Component/Core/Model/OrderSequence.php @@ -17,9 +17,7 @@ class OrderSequence extends BaseOrderSequence implements OrderSequenceInterface { - /** - * @var int - */ + /** @var int */ protected $version = 1; public function getVersion(): ?int diff --git a/src/Sylius/Component/Core/Model/PaymentMethod.php b/src/Sylius/Component/Core/Model/PaymentMethod.php index 6976cfaaa61..a5309732446 100644 --- a/src/Sylius/Component/Core/Model/PaymentMethod.php +++ b/src/Sylius/Component/Core/Model/PaymentMethod.php @@ -29,9 +29,7 @@ class PaymentMethod extends BasePaymentMethod implements PaymentMethodInterface */ protected $channels; - /** - * @var GatewayConfigInterface|null - */ + /** @var GatewayConfigInterface|null */ protected $gatewayConfig; public function __construct() diff --git a/src/Sylius/Component/Core/Model/Product.php b/src/Sylius/Component/Core/Model/Product.php index 8a3cccbf838..fde8eaf0975 100644 --- a/src/Sylius/Component/Core/Model/Product.php +++ b/src/Sylius/Component/Core/Model/Product.php @@ -24,9 +24,7 @@ class Product extends BaseProduct implements ProductInterface, ReviewableProductInterface { - /** - * @var string|null - */ + /** @var string|null */ protected $variantSelectionMethod = self::VARIANT_SELECTION_CHOICE; /** @@ -43,9 +41,7 @@ class Product extends BaseProduct implements ProductInterface, ReviewableProduct */ protected $channels; - /** - * @var \Sylius\Component\Core\Model\TaxonInterface|null - */ + /** @var \Sylius\Component\Core\Model\TaxonInterface|null */ protected $mainTaxon; /** @@ -55,9 +51,7 @@ class Product extends BaseProduct implements ProductInterface, ReviewableProduct */ protected $reviews; - /** - * @var float - */ + /** @var float */ protected $averageRating = 0.0; /** diff --git a/src/Sylius/Component/Core/Model/ProductTaxon.php b/src/Sylius/Component/Core/Model/ProductTaxon.php index 8cc64ab7ae3..3def5036ce7 100644 --- a/src/Sylius/Component/Core/Model/ProductTaxon.php +++ b/src/Sylius/Component/Core/Model/ProductTaxon.php @@ -18,19 +18,13 @@ class ProductTaxon implements ProductTaxonInterface /** @var mixed */ protected $id; - /** - * @var ProductInterface|null - */ + /** @var ProductInterface|null */ protected $product; - /** - * @var TaxonInterface|null - */ + /** @var TaxonInterface|null */ protected $taxon; - /** - * @var int|null - */ + /** @var int|null */ protected $position; public function getId() diff --git a/src/Sylius/Component/Core/Model/ProductTranslation.php b/src/Sylius/Component/Core/Model/ProductTranslation.php index 3e851917ccf..1d2a95f91af 100644 --- a/src/Sylius/Component/Core/Model/ProductTranslation.php +++ b/src/Sylius/Component/Core/Model/ProductTranslation.php @@ -17,9 +17,7 @@ class ProductTranslation extends BaseProductTranslation implements ProductTranslationInterface { - /** - * @var string|null - */ + /** @var string|null */ protected $shortDescription; public function getShortDescription(): ?string diff --git a/src/Sylius/Component/Core/Model/ProductVariant.php b/src/Sylius/Component/Core/Model/ProductVariant.php index 40cae310482..6921b3f0c76 100644 --- a/src/Sylius/Component/Core/Model/ProductVariant.php +++ b/src/Sylius/Component/Core/Model/ProductVariant.php @@ -22,64 +22,40 @@ class ProductVariant extends BaseVariant implements ProductVariantInterface, Comparable, \Stringable { - /** - * @var int - */ + /** @var int */ protected $version = 1; - /** - * @var int - */ + /** @var int */ protected $onHold = 0; - /** - * @var int - */ + /** @var int */ protected $onHand = 0; - /** - * @var bool - */ + /** @var bool */ protected $tracked = false; - /** - * @var float|null - */ + /** @var float|null */ protected $weight; - /** - * @var float|null - */ + /** @var float|null */ protected $width; - /** - * @var float|null - */ + /** @var float|null */ protected $height; - /** - * @var float|null - */ + /** @var float|null */ protected $depth; - /** - * @var TaxCategoryInterface|null - */ + /** @var TaxCategoryInterface|null */ protected $taxCategory; - /** - * @var ShippingCategoryInterface|null - */ + /** @var ShippingCategoryInterface|null */ protected $shippingCategory; - /** - * @var Collection - */ + /** @var Collection */ protected $channelPricings; - /** - * @var bool - */ + /** @var bool */ protected $shippingRequired = true; /** diff --git a/src/Sylius/Component/Core/Model/PromotionCoupon.php b/src/Sylius/Component/Core/Model/PromotionCoupon.php index fcd305cd264..06298985cb8 100644 --- a/src/Sylius/Component/Core/Model/PromotionCoupon.php +++ b/src/Sylius/Component/Core/Model/PromotionCoupon.php @@ -17,14 +17,10 @@ class PromotionCoupon extends BasePromotionCoupon implements PromotionCouponInterface { - /** - * @var int|null - */ + /** @var int|null */ protected $perCustomerUsageLimit; - /** - * @var bool - */ + /** @var bool */ protected $reusableFromCancelledOrders = true; public function getPerCustomerUsageLimit(): ?int diff --git a/src/Sylius/Component/Core/Model/Shipment.php b/src/Sylius/Component/Core/Model/Shipment.php index 064b69ee2b1..7d9af9acc65 100644 --- a/src/Sylius/Component/Core/Model/Shipment.php +++ b/src/Sylius/Component/Core/Model/Shipment.php @@ -31,9 +31,7 @@ class Shipment extends BaseShipment implements ShipmentInterface */ protected $adjustments; - /** - * @var int - */ + /** @var int */ protected $adjustmentsTotal = 0; public function __construct() diff --git a/src/Sylius/Component/Core/Model/ShippingMethod.php b/src/Sylius/Component/Core/Model/ShippingMethod.php index b79d098f351..4d6e10ca9c3 100644 --- a/src/Sylius/Component/Core/Model/ShippingMethod.php +++ b/src/Sylius/Component/Core/Model/ShippingMethod.php @@ -23,14 +23,10 @@ class ShippingMethod extends BaseShippingMethod implements ShippingMethodInterface { - /** - * @var ZoneInterface|null - */ + /** @var ZoneInterface|null */ protected $zone; - /** - * @var TaxCategoryInterface|null - */ + /** @var TaxCategoryInterface|null */ protected $taxCategory; /** diff --git a/src/Sylius/Component/Core/Model/ShopBillingData.php b/src/Sylius/Component/Core/Model/ShopBillingData.php index 8bf059a4ed2..d253ae97818 100644 --- a/src/Sylius/Component/Core/Model/ShopBillingData.php +++ b/src/Sylius/Component/Core/Model/ShopBillingData.php @@ -16,36 +16,24 @@ class ShopBillingData implements ShopBillingDataInterface { /** @var mixed */ - protected $id = null; + protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $company; - /** - * @var string|null - */ + /** @var string|null */ protected $taxId; - /** - * @var string|null - */ + /** @var string|null */ protected $countryCode; - /** - * @var string|null - */ + /** @var string|null */ protected $street; - /** - * @var string|null - */ + /** @var string|null */ protected $city; - /** - * @var string|null - */ + /** @var string|null */ protected $postcode; public function getId() diff --git a/src/Sylius/Component/Core/Model/TaxRate.php b/src/Sylius/Component/Core/Model/TaxRate.php index 00eada171f2..c46d3030354 100644 --- a/src/Sylius/Component/Core/Model/TaxRate.php +++ b/src/Sylius/Component/Core/Model/TaxRate.php @@ -18,9 +18,7 @@ class TaxRate extends BaseTaxRate implements TaxRateInterface { - /** - * @var ZoneInterface|null - */ + /** @var ZoneInterface|null */ protected $zone; public function getZone(): ?ZoneInterface diff --git a/src/Sylius/Component/Core/Promotion/Filter/TaxonFilter.php b/src/Sylius/Component/Core/Promotion/Filter/TaxonFilter.php index 5aa684aee1f..acd8931d767 100644 --- a/src/Sylius/Component/Core/Promotion/Filter/TaxonFilter.php +++ b/src/Sylius/Component/Core/Promotion/Filter/TaxonFilter.php @@ -14,7 +14,6 @@ namespace Sylius\Component\Core\Promotion\Filter; use Sylius\Component\Core\Model\ProductInterface; -use Sylius\Component\Core\Model\TaxonInterface; final class TaxonFilter implements FilterInterface { diff --git a/src/Sylius/Component/Core/Uploader/ImageUploader.php b/src/Sylius/Component/Core/Uploader/ImageUploader.php index f6f4f5283a3..dacd5814e88 100644 --- a/src/Sylius/Component/Core/Uploader/ImageUploader.php +++ b/src/Sylius/Component/Core/Uploader/ImageUploader.php @@ -24,6 +24,7 @@ class ImageUploader implements ImageUploaderInterface { private const MIME_SVG_XML = 'image/svg+xml'; + private const MIME_SVG = 'image/svg'; /** @var Sanitizer */ diff --git a/src/Sylius/Component/Currency/Model/Currency.php b/src/Sylius/Component/Currency/Model/Currency.php index f4b2fec6f1f..b6f7370bad4 100644 --- a/src/Sylius/Component/Currency/Model/Currency.php +++ b/src/Sylius/Component/Currency/Model/Currency.php @@ -23,9 +23,7 @@ class Currency implements CurrencyInterface, \Stringable /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $code; public function __construct() diff --git a/src/Sylius/Component/Currency/Model/ExchangeRate.php b/src/Sylius/Component/Currency/Model/ExchangeRate.php index 980b8584711..4ecbbfa4644 100644 --- a/src/Sylius/Component/Currency/Model/ExchangeRate.php +++ b/src/Sylius/Component/Currency/Model/ExchangeRate.php @@ -22,19 +22,13 @@ class ExchangeRate implements ExchangeRateInterface /** @var mixed */ protected $id; - /** - * @var float|null - */ + /** @var float|null */ protected $ratio; - /** - * @var CurrencyInterface|null - */ + /** @var CurrencyInterface|null */ protected $sourceCurrency; - /** - * @var CurrencyInterface|null - */ + /** @var CurrencyInterface|null */ protected $targetCurrency; public function __construct() diff --git a/src/Sylius/Component/Customer/Model/Customer.php b/src/Sylius/Component/Customer/Model/Customer.php index a0103d8dc8d..39084daf646 100644 --- a/src/Sylius/Component/Customer/Model/Customer.php +++ b/src/Sylius/Component/Customer/Model/Customer.php @@ -22,49 +22,31 @@ class Customer implements CustomerInterface, \Stringable /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $email; - /** - * @var string|null - */ + /** @var string|null */ protected $emailCanonical; - /** - * @var string|null - */ + /** @var string|null */ protected $firstName; - /** - * @var string|null - */ + /** @var string|null */ protected $lastName; - /** - * @var \DateTimeInterface|null - */ + /** @var \DateTimeInterface|null */ protected $birthday; - /** - * @var string - */ + /** @var string */ protected $gender = CustomerInterface::UNKNOWN_GENDER; - /** - * @var CustomerGroupInterface|null - */ + /** @var CustomerGroupInterface|null */ protected $group; - /** - * @var string|null - */ + /** @var string|null */ protected $phoneNumber; - /** - * @var bool - */ + /** @var bool */ protected $subscribedToNewsletter = false; public function __construct() diff --git a/src/Sylius/Component/Customer/Model/CustomerGroup.php b/src/Sylius/Component/Customer/Model/CustomerGroup.php index 58f56e8a1ef..034ff665f2a 100644 --- a/src/Sylius/Component/Customer/Model/CustomerGroup.php +++ b/src/Sylius/Component/Customer/Model/CustomerGroup.php @@ -18,14 +18,10 @@ class CustomerGroup implements CustomerGroupInterface, \Stringable /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $code; - /** - * @var string|null - */ + /** @var string|null */ protected $name; public function __toString(): string diff --git a/src/Sylius/Component/Inventory/Model/InventoryUnit.php b/src/Sylius/Component/Inventory/Model/InventoryUnit.php index 65dc46e94a5..a5c62a1ce93 100644 --- a/src/Sylius/Component/Inventory/Model/InventoryUnit.php +++ b/src/Sylius/Component/Inventory/Model/InventoryUnit.php @@ -18,9 +18,7 @@ class InventoryUnit implements InventoryUnitInterface /** @var mixed */ protected $id; - /** - * @var StockableInterface|null - */ + /** @var StockableInterface|null */ protected $stockable; public function getId() diff --git a/src/Sylius/Component/Locale/Model/Locale.php b/src/Sylius/Component/Locale/Model/Locale.php index 30d9a44c092..8c5889dfd3b 100644 --- a/src/Sylius/Component/Locale/Model/Locale.php +++ b/src/Sylius/Component/Locale/Model/Locale.php @@ -20,12 +20,10 @@ class Locale implements LocaleInterface, \Stringable { use TimestampableTrait; - /** @var mixed */ - protected $id = null; + /** @var mixed */ + protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $code; public function __construct() diff --git a/src/Sylius/Component/Order/Model/Adjustment.php b/src/Sylius/Component/Order/Model/Adjustment.php index 175ef9f53d6..dddb257e092 100644 --- a/src/Sylius/Component/Order/Model/Adjustment.php +++ b/src/Sylius/Component/Order/Model/Adjustment.php @@ -22,54 +22,34 @@ class Adjustment implements AdjustmentInterface /** @var mixed */ protected $id; - /** - * @var OrderInterface|null - */ + /** @var OrderInterface|null */ protected $order; - /** - * @var OrderItemInterface|null - */ + /** @var OrderItemInterface|null */ protected $orderItem; - /** - * @var OrderItemUnitInterface|null - */ + /** @var OrderItemUnitInterface|null */ protected $orderItemUnit; - /** - * @var string|null - */ + /** @var string|null */ protected $type; - /** - * @var string|null - */ + /** @var string|null */ protected $label; - /** - * @var int - */ + /** @var int */ protected $amount = 0; - /** - * @var bool - */ + /** @var bool */ protected $neutral = false; - /** - * @var bool - */ + /** @var bool */ protected $locked = false; - /** - * @var string|null - */ + /** @var string|null */ protected $originCode; - /** - * @var mixed[] - */ + /** @var mixed[] */ protected $details = []; public function __construct() diff --git a/src/Sylius/Component/Order/Model/Order.php b/src/Sylius/Component/Order/Model/Order.php index 4f830bf80a8..48919dc3db5 100644 --- a/src/Sylius/Component/Order/Model/Order.php +++ b/src/Sylius/Component/Order/Model/Order.php @@ -24,19 +24,13 @@ class Order implements OrderInterface /** @var mixed */ protected $id; - /** - * @var \DateTimeInterface|null - */ + /** @var \DateTimeInterface|null */ protected $checkoutCompletedAt; - /** - * @var string|null - */ + /** @var string|null */ protected $number; - /** - * @var string|null - */ + /** @var string|null */ protected $notes; /** @@ -46,9 +40,7 @@ class Order implements OrderInterface */ protected $items; - /** - * @var int - */ + /** @var int */ protected $itemsTotal = 0; /** @@ -58,20 +50,17 @@ class Order implements OrderInterface */ protected $adjustments; - /** - * @var int - */ + /** @var int */ protected $adjustmentsTotal = 0; /** * Items total + adjustments total. + * * @var int */ protected $total = 0; - /** - * @var string - */ + /** @var string */ protected $state = OrderInterface::STATE_CART; public function __construct() diff --git a/src/Sylius/Component/Order/Model/OrderItem.php b/src/Sylius/Component/Order/Model/OrderItem.php index 48a978850e4..a8af1e4b2f4 100644 --- a/src/Sylius/Component/Order/Model/OrderItem.php +++ b/src/Sylius/Component/Order/Model/OrderItem.php @@ -21,31 +21,21 @@ class OrderItem implements OrderItemInterface /** @var mixed */ protected $id; - /** - * @var OrderInterface|null - */ + /** @var OrderInterface|null */ protected $order; - /** - * @var int - */ + /** @var int */ protected $quantity = 0; - /** - * @var int - */ + /** @var int */ protected $unitPrice = 0; protected ?int $originalUnitPrice = 0; - /** - * @var int - */ + /** @var int */ protected $total = 0; - /** - * @var bool - */ + /** @var bool */ protected $immutable = false; /** @@ -55,9 +45,7 @@ class OrderItem implements OrderItemInterface */ protected $units; - /** - * @var int - */ + /** @var int */ protected $unitsTotal = 0; /** @@ -67,9 +55,7 @@ class OrderItem implements OrderItemInterface */ protected $adjustments; - /** - * @var int - */ + /** @var int */ protected $adjustmentsTotal = 0; public function __construct() diff --git a/src/Sylius/Component/Order/Model/OrderItemUnit.php b/src/Sylius/Component/Order/Model/OrderItemUnit.php index 80ade7eb331..7e6484c0d9c 100644 --- a/src/Sylius/Component/Order/Model/OrderItemUnit.php +++ b/src/Sylius/Component/Order/Model/OrderItemUnit.php @@ -19,7 +19,7 @@ class OrderItemUnit implements OrderItemUnitInterface { /** @var mixed */ - protected $id = null; + protected $id; /** * @var Collection|AdjustmentInterface[] @@ -28,9 +28,7 @@ class OrderItemUnit implements OrderItemUnitInterface */ protected $adjustments; - /** - * @var int - */ + /** @var int */ protected $adjustmentsTotal = 0; public function __construct(protected OrderItemInterface $orderItem) diff --git a/src/Sylius/Component/Order/Model/OrderSequence.php b/src/Sylius/Component/Order/Model/OrderSequence.php index 81a6bfbb71b..678c5a8d74a 100644 --- a/src/Sylius/Component/Order/Model/OrderSequence.php +++ b/src/Sylius/Component/Order/Model/OrderSequence.php @@ -18,9 +18,7 @@ class OrderSequence implements OrderSequenceInterface /** @var mixed */ protected $id; - /** - * @var int - */ + /** @var int */ protected $index = 0; public function getId() diff --git a/src/Sylius/Component/Payment/Model/Payment.php b/src/Sylius/Component/Payment/Model/Payment.php index fcf234e86b2..c1b24deba3f 100644 --- a/src/Sylius/Component/Payment/Model/Payment.php +++ b/src/Sylius/Component/Payment/Model/Payment.php @@ -22,29 +22,19 @@ class Payment implements PaymentInterface /** @var mixed */ protected $id; - /** - * @var PaymentMethodInterface|null - */ + /** @var PaymentMethodInterface|null */ protected $method; - /** - * @var string|null - */ + /** @var string|null */ protected $currencyCode; - /** - * @var int - */ + /** @var int */ protected $amount = 0; - /** - * @var string|null - */ + /** @var string|null */ protected $state = PaymentInterface::STATE_CART; - /** - * @var mixed[] - */ + /** @var mixed[] */ protected $details = []; public function __construct() diff --git a/src/Sylius/Component/Payment/Model/PaymentMethod.php b/src/Sylius/Component/Payment/Model/PaymentMethod.php index 13c06dfbb58..87c30f9f862 100644 --- a/src/Sylius/Component/Payment/Model/PaymentMethod.php +++ b/src/Sylius/Component/Payment/Model/PaymentMethod.php @@ -29,19 +29,13 @@ class PaymentMethod implements PaymentMethodInterface, \Stringable /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $code; - /** - * @var string|null - */ + /** @var string|null */ protected $environment; - /** - * @var int|null - */ + /** @var int|null */ protected $position; public function __construct() diff --git a/src/Sylius/Component/Payment/Model/PaymentMethodTranslation.php b/src/Sylius/Component/Payment/Model/PaymentMethodTranslation.php index f7faa58ef5a..cda6f64e1aa 100644 --- a/src/Sylius/Component/Payment/Model/PaymentMethodTranslation.php +++ b/src/Sylius/Component/Payment/Model/PaymentMethodTranslation.php @@ -20,19 +20,13 @@ class PaymentMethodTranslation extends AbstractTranslation implements PaymentMet /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $name; - /** - * @var string|null - */ + /** @var string|null */ protected $description; - /** - * @var string|null - */ + /** @var string|null */ protected $instructions; public function __toString(): string diff --git a/src/Sylius/Component/Product/Model/Product.php b/src/Sylius/Component/Product/Model/Product.php index f2c7fa9ee38..18ba8ef29bc 100644 --- a/src/Sylius/Component/Product/Model/Product.php +++ b/src/Sylius/Component/Product/Model/Product.php @@ -33,9 +33,7 @@ class Product implements ProductInterface, \Stringable /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $code; /** diff --git a/src/Sylius/Component/Product/Model/ProductAssociation.php b/src/Sylius/Component/Product/Model/ProductAssociation.php index 4c2d7da5c74..5c0511a511d 100644 --- a/src/Sylius/Component/Product/Model/ProductAssociation.php +++ b/src/Sylius/Component/Product/Model/ProductAssociation.php @@ -24,14 +24,10 @@ class ProductAssociation implements ProductAssociationInterface /** @var mixed */ protected $id; - /** - * @var ProductAssociationTypeInterface|null - */ + /** @var ProductAssociationTypeInterface|null */ protected $type; - /** - * @var ProductInterface|null - */ + /** @var ProductInterface|null */ protected $owner; /** diff --git a/src/Sylius/Component/Product/Model/ProductAssociationType.php b/src/Sylius/Component/Product/Model/ProductAssociationType.php index baa9ca02744..6a9ae8ff948 100644 --- a/src/Sylius/Component/Product/Model/ProductAssociationType.php +++ b/src/Sylius/Component/Product/Model/ProductAssociationType.php @@ -26,16 +26,12 @@ class ProductAssociationType implements ProductAssociationTypeInterface, \String } /** @var mixed */ - protected $id = null; + protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $code; - /** - * @var string|null - */ + /** @var string|null */ protected $name; public function __construct() diff --git a/src/Sylius/Component/Product/Model/ProductAssociationTypeTranslation.php b/src/Sylius/Component/Product/Model/ProductAssociationTypeTranslation.php index eab6e3bfbee..5d102e7e4ff 100644 --- a/src/Sylius/Component/Product/Model/ProductAssociationTypeTranslation.php +++ b/src/Sylius/Component/Product/Model/ProductAssociationTypeTranslation.php @@ -20,9 +20,7 @@ class ProductAssociationTypeTranslation extends AbstractTranslation implements P /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $name; public function getId() diff --git a/src/Sylius/Component/Product/Model/ProductOption.php b/src/Sylius/Component/Product/Model/ProductOption.php index 3958c9e2e70..16778b73dd0 100644 --- a/src/Sylius/Component/Product/Model/ProductOption.php +++ b/src/Sylius/Component/Product/Model/ProductOption.php @@ -30,14 +30,10 @@ class ProductOption implements ProductOptionInterface, \Stringable /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $code; - /** - * @var int|null - */ + /** @var int|null */ protected $position; /** diff --git a/src/Sylius/Component/Product/Model/ProductOptionTranslation.php b/src/Sylius/Component/Product/Model/ProductOptionTranslation.php index 71c2b84cd1e..d07d2657199 100644 --- a/src/Sylius/Component/Product/Model/ProductOptionTranslation.php +++ b/src/Sylius/Component/Product/Model/ProductOptionTranslation.php @@ -20,9 +20,7 @@ class ProductOptionTranslation extends AbstractTranslation implements ProductOpt /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $name; public function getId() diff --git a/src/Sylius/Component/Product/Model/ProductOptionValue.php b/src/Sylius/Component/Product/Model/ProductOptionValue.php index 94b5aae96fb..09eeb40d623 100644 --- a/src/Sylius/Component/Product/Model/ProductOptionValue.php +++ b/src/Sylius/Component/Product/Model/ProductOptionValue.php @@ -26,14 +26,10 @@ class ProductOptionValue implements ProductOptionValueInterface, \Stringable /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $code; - /** - * @var ProductOptionInterface|null - */ + /** @var ProductOptionInterface|null */ protected $option; public function __construct() diff --git a/src/Sylius/Component/Product/Model/ProductOptionValueTranslation.php b/src/Sylius/Component/Product/Model/ProductOptionValueTranslation.php index 7caf138e817..b5c269355e2 100644 --- a/src/Sylius/Component/Product/Model/ProductOptionValueTranslation.php +++ b/src/Sylius/Component/Product/Model/ProductOptionValueTranslation.php @@ -20,9 +20,7 @@ class ProductOptionValueTranslation extends AbstractTranslation implements Produ /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $value; public function getId() diff --git a/src/Sylius/Component/Product/Model/ProductTranslation.php b/src/Sylius/Component/Product/Model/ProductTranslation.php index 9b39a9ffd02..c63254206f4 100644 --- a/src/Sylius/Component/Product/Model/ProductTranslation.php +++ b/src/Sylius/Component/Product/Model/ProductTranslation.php @@ -20,29 +20,19 @@ class ProductTranslation extends AbstractTranslation implements ProductTranslati /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $name; - /** - * @var string|null - */ + /** @var string|null */ protected $slug; - /** - * @var string|null - */ + /** @var string|null */ protected $description; - /** - * @var string|null - */ + /** @var string|null */ protected $metaKeywords; - /** - * @var string|null - */ + /** @var string|null */ protected $metaDescription; public function getId() diff --git a/src/Sylius/Component/Product/Model/ProductVariant.php b/src/Sylius/Component/Product/Model/ProductVariant.php index 5aabe8012c6..27e013e966e 100644 --- a/src/Sylius/Component/Product/Model/ProductVariant.php +++ b/src/Sylius/Component/Product/Model/ProductVariant.php @@ -31,14 +31,10 @@ class ProductVariant implements ProductVariantInterface /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $code; - /** - * @var ProductInterface|null - */ + /** @var ProductInterface|null */ protected $product; /** @@ -48,9 +44,7 @@ class ProductVariant implements ProductVariantInterface */ protected $optionValues; - /** - * @var int|null - */ + /** @var int|null */ protected $position; public function __construct() diff --git a/src/Sylius/Component/Product/Model/ProductVariantTranslation.php b/src/Sylius/Component/Product/Model/ProductVariantTranslation.php index 33fd58dd0df..bd7b41316fd 100644 --- a/src/Sylius/Component/Product/Model/ProductVariantTranslation.php +++ b/src/Sylius/Component/Product/Model/ProductVariantTranslation.php @@ -20,9 +20,7 @@ class ProductVariantTranslation extends AbstractTranslation implements ProductVa /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $name; public function getId() diff --git a/src/Sylius/Component/Promotion/Model/Promotion.php b/src/Sylius/Component/Promotion/Model/Promotion.php index 45835ccb030..276b5162c0b 100644 --- a/src/Sylius/Component/Promotion/Model/Promotion.php +++ b/src/Sylius/Component/Promotion/Model/Promotion.php @@ -24,56 +24,42 @@ class Promotion implements PromotionInterface /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $code; - /** - * @var string|null - */ + /** @var string|null */ protected $name; - /** - * @var string|null - */ + /** @var string|null */ protected $description; /** * When exclusive, promotion with top priority will be applied + * * @var int */ protected $priority = 0; /** * Cannot be applied together with other promotions + * * @var bool */ protected $exclusive = false; - /** - * @var int|null - */ + /** @var int|null */ protected $usageLimit; - /** - * @var int - */ + /** @var int */ protected $used = 0; - /** - * @var \DateTimeInterface|null - */ + /** @var \DateTimeInterface|null */ protected $startsAt; - /** - * @var \DateTimeInterface|null - */ + /** @var \DateTimeInterface|null */ protected $endsAt; - /** - * @var bool - */ + /** @var bool */ protected $couponBased = false; /** diff --git a/src/Sylius/Component/Promotion/Model/PromotionAction.php b/src/Sylius/Component/Promotion/Model/PromotionAction.php index 06c7cc74650..7b380b646a4 100644 --- a/src/Sylius/Component/Promotion/Model/PromotionAction.php +++ b/src/Sylius/Component/Promotion/Model/PromotionAction.php @@ -18,19 +18,13 @@ class PromotionAction implements PromotionActionInterface /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $type; - /** - * @var mixed[] - */ + /** @var mixed[] */ protected $configuration = []; - /** - * @var PromotionInterface|null - */ + /** @var PromotionInterface|null */ protected $promotion; public function getId() diff --git a/src/Sylius/Component/Promotion/Model/PromotionCoupon.php b/src/Sylius/Component/Promotion/Model/PromotionCoupon.php index 0a77ecfbf8e..780dd8b4468 100644 --- a/src/Sylius/Component/Promotion/Model/PromotionCoupon.php +++ b/src/Sylius/Component/Promotion/Model/PromotionCoupon.php @@ -22,29 +22,19 @@ class PromotionCoupon implements PromotionCouponInterface /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $code; - /** - * @var int|null - */ + /** @var int|null */ protected $usageLimit; - /** - * @var int - */ + /** @var int */ protected $used = 0; - /** - * @var PromotionInterface|null - */ + /** @var PromotionInterface|null */ protected $promotion; - /** - * @var \DateTimeInterface|null - */ + /** @var \DateTimeInterface|null */ protected $expiresAt; public function getId() diff --git a/src/Sylius/Component/Promotion/Model/PromotionRule.php b/src/Sylius/Component/Promotion/Model/PromotionRule.php index 223653ffcbe..02e55bdfc22 100644 --- a/src/Sylius/Component/Promotion/Model/PromotionRule.php +++ b/src/Sylius/Component/Promotion/Model/PromotionRule.php @@ -18,19 +18,13 @@ class PromotionRule implements PromotionRuleInterface /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $type; - /** - * @var mixed[] - */ + /** @var mixed[] */ protected $configuration = []; - /** - * @var PromotionInterface|null - */ + /** @var PromotionInterface|null */ protected $promotion; public function getId() diff --git a/src/Sylius/Component/Review/Model/Review.php b/src/Sylius/Component/Review/Model/Review.php index 6bcb2973451..8f0c6d85483 100644 --- a/src/Sylius/Component/Review/Model/Review.php +++ b/src/Sylius/Component/Review/Model/Review.php @@ -20,36 +20,24 @@ class Review implements ReviewInterface use TimestampableTrait; /** @var mixed */ - protected $id = null; + protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $title; - /** - * @var int|null - */ + /** @var int|null */ protected $rating; - /** - * @var string|null - */ + /** @var string|null */ protected $comment; - /** - * @var ReviewerInterface|null - */ + /** @var ReviewerInterface|null */ protected $author; - /** - * @var string - */ + /** @var string */ protected $status = ReviewInterface::STATUS_NEW; - /** - * @var ReviewableInterface|null - */ + /** @var ReviewableInterface|null */ protected $reviewSubject; public function __construct() diff --git a/src/Sylius/Component/Review/Model/Reviewer.php b/src/Sylius/Component/Review/Model/Reviewer.php index d45cf673fa3..73e314ba877 100644 --- a/src/Sylius/Component/Review/Model/Reviewer.php +++ b/src/Sylius/Component/Review/Model/Reviewer.php @@ -16,21 +16,15 @@ class Reviewer implements ReviewerInterface { /** @var mixed */ - protected $id = null; + protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $email; - /** - * @var string|null - */ + /** @var string|null */ protected $firstName; - /** - * @var string|null - */ + /** @var string|null */ protected $lastName; /** diff --git a/src/Sylius/Component/Shipping/Model/Shipment.php b/src/Sylius/Component/Shipping/Model/Shipment.php index b5523b2d6da..99969cf3026 100644 --- a/src/Sylius/Component/Shipping/Model/Shipment.php +++ b/src/Sylius/Component/Shipping/Model/Shipment.php @@ -24,14 +24,10 @@ class Shipment implements ShipmentInterface, \Stringable /** @var mixed */ protected $id; - /** - * @var string - */ + /** @var string */ protected $state = ShipmentInterface::STATE_CART; - /** - * @var ShippingMethodInterface|null - */ + /** @var ShippingMethodInterface|null */ protected $method; /** @@ -41,14 +37,10 @@ class Shipment implements ShipmentInterface, \Stringable */ protected $units; - /** - * @var string|null - */ + /** @var string|null */ protected $tracking; - /** - * @var \DateTimeInterface|null - */ + /** @var \DateTimeInterface|null */ protected $shippedAt; public function __construct() diff --git a/src/Sylius/Component/Shipping/Model/ShipmentUnit.php b/src/Sylius/Component/Shipping/Model/ShipmentUnit.php index f00cd2ad521..77e4525427d 100644 --- a/src/Sylius/Component/Shipping/Model/ShipmentUnit.php +++ b/src/Sylius/Component/Shipping/Model/ShipmentUnit.php @@ -22,14 +22,10 @@ class ShipmentUnit implements ShipmentUnitInterface, \Stringable /** @var mixed */ protected $id; - /** - * @var ShipmentInterface|null - */ + /** @var ShipmentInterface|null */ protected $shipment; - /** - * @var ShippableInterface|null - */ + /** @var ShippableInterface|null */ protected $shippable; public function __construct() diff --git a/src/Sylius/Component/Shipping/Model/ShippingCategory.php b/src/Sylius/Component/Shipping/Model/ShippingCategory.php index 8ecf1172dc3..165200496b4 100644 --- a/src/Sylius/Component/Shipping/Model/ShippingCategory.php +++ b/src/Sylius/Component/Shipping/Model/ShippingCategory.php @@ -22,19 +22,13 @@ class ShippingCategory implements ShippingCategoryInterface, \Stringable /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $code; - /** - * @var string|null - */ + /** @var string|null */ protected $name; - /** - * @var string|null - */ + /** @var string|null */ protected $description; public function __construct() diff --git a/src/Sylius/Component/Shipping/Model/ShippingMethod.php b/src/Sylius/Component/Shipping/Model/ShippingMethod.php index 92dfe537e54..e78723fcd66 100644 --- a/src/Sylius/Component/Shipping/Model/ShippingMethod.php +++ b/src/Sylius/Component/Shipping/Model/ShippingMethod.php @@ -32,34 +32,22 @@ class ShippingMethod implements ShippingMethodInterface, \Stringable /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $code; - /** - * @var int|null - */ + /** @var int|null */ protected $position; - /** - * @var ShippingCategoryInterface|null - */ + /** @var ShippingCategoryInterface|null */ protected $category; - /** - * @var int - */ + /** @var int */ protected $categoryRequirement = ShippingMethodInterface::CATEGORY_REQUIREMENT_MATCH_ANY; - /** - * @var string|null - */ + /** @var string|null */ protected $calculator; - /** - * @var mixed[] - */ + /** @var mixed[] */ protected $configuration = []; /** diff --git a/src/Sylius/Component/Shipping/Model/ShippingMethodRule.php b/src/Sylius/Component/Shipping/Model/ShippingMethodRule.php index d6717fcb5b8..c26ee68aa4d 100644 --- a/src/Sylius/Component/Shipping/Model/ShippingMethodRule.php +++ b/src/Sylius/Component/Shipping/Model/ShippingMethodRule.php @@ -21,19 +21,13 @@ class ShippingMethodRule implements ShippingMethodRuleInterface /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $type; - /** - * @var mixed[] - */ + /** @var mixed[] */ protected $configuration = []; - /** - * @var ShippingMethodInterface|null - */ + /** @var ShippingMethodInterface|null */ protected $shippingMethod; public function getId() diff --git a/src/Sylius/Component/Shipping/Model/ShippingMethodTranslation.php b/src/Sylius/Component/Shipping/Model/ShippingMethodTranslation.php index f24987b6f73..55556dab949 100644 --- a/src/Sylius/Component/Shipping/Model/ShippingMethodTranslation.php +++ b/src/Sylius/Component/Shipping/Model/ShippingMethodTranslation.php @@ -20,14 +20,10 @@ class ShippingMethodTranslation extends AbstractTranslation implements ShippingM /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $name; - /** - * @var string|null - */ + /** @var string|null */ protected $description; public function __toString(): string diff --git a/src/Sylius/Component/Taxation/Model/TaxCategory.php b/src/Sylius/Component/Taxation/Model/TaxCategory.php index 6895fccd6fc..28449ac3f0a 100644 --- a/src/Sylius/Component/Taxation/Model/TaxCategory.php +++ b/src/Sylius/Component/Taxation/Model/TaxCategory.php @@ -24,19 +24,13 @@ class TaxCategory implements TaxCategoryInterface, \Stringable /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $code; - /** - * @var string|null - */ + /** @var string|null */ protected $name; - /** - * @var string|null - */ + /** @var string|null */ protected $description; /** diff --git a/src/Sylius/Component/Taxation/Model/TaxRate.php b/src/Sylius/Component/Taxation/Model/TaxRate.php index 580a0c2115c..4e251fed125 100644 --- a/src/Sylius/Component/Taxation/Model/TaxRate.php +++ b/src/Sylius/Component/Taxation/Model/TaxRate.php @@ -22,34 +22,22 @@ class TaxRate implements TaxRateInterface /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $code; - /** - * @var TaxCategoryInterface|null - */ + /** @var TaxCategoryInterface|null */ protected $category; - /** - * @var string|null - */ + /** @var string|null */ protected $name; - /** - * @var float|null - */ + /** @var float|null */ protected $amount = 0.0; - /** - * @var bool - */ + /** @var bool */ protected $includedInPrice = false; - /** - * @var string|null - */ + /** @var string|null */ protected $calculator; public function __construct() diff --git a/src/Sylius/Component/Taxonomy/Model/Taxon.php b/src/Sylius/Component/Taxonomy/Model/Taxon.php index b27c5185715..98d8a468cc0 100644 --- a/src/Sylius/Component/Taxonomy/Model/Taxon.php +++ b/src/Sylius/Component/Taxonomy/Model/Taxon.php @@ -30,19 +30,13 @@ class Taxon implements TaxonInterface, \Stringable /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $code; - /** - * @var TaxonInterface|null - */ + /** @var TaxonInterface|null */ protected $root; - /** - * @var TaxonInterface|null - */ + /** @var TaxonInterface|null */ protected $parent; /** @@ -52,24 +46,16 @@ class Taxon implements TaxonInterface, \Stringable */ protected $children; - /** - * @var int|null - */ + /** @var int|null */ protected $left; - /** - * @var int|null - */ + /** @var int|null */ protected $right; - /** - * @var int|null - */ + /** @var int|null */ protected $level; - /** - * @var int|null - */ + /** @var int|null */ protected $position; public function __construct() diff --git a/src/Sylius/Component/Taxonomy/Model/TaxonTranslation.php b/src/Sylius/Component/Taxonomy/Model/TaxonTranslation.php index 503a07c1613..d0fbb73999e 100644 --- a/src/Sylius/Component/Taxonomy/Model/TaxonTranslation.php +++ b/src/Sylius/Component/Taxonomy/Model/TaxonTranslation.php @@ -20,19 +20,13 @@ class TaxonTranslation extends AbstractTranslation implements TaxonTranslationIn /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $name; - /** - * @var string|null - */ + /** @var string|null */ protected $slug; - /** - * @var string|null - */ + /** @var string|null */ protected $description; public function __toString(): string diff --git a/src/Sylius/Component/User/Model/User.php b/src/Sylius/Component/User/Model/User.php index 39061c4ca4a..b6698b80620 100644 --- a/src/Sylius/Component/User/Model/User.php +++ b/src/Sylius/Component/User/Model/User.php @@ -25,79 +25,72 @@ class User implements UserInterface, \Stringable /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $username; /** * Normalized representation of a username. + * * @var string|null */ protected $usernameCanonical; /** * Random data that is used as an additional input to a function that hashes a password. + * * @var string */ protected $salt; /** * Encrypted password. Must be persisted. + * * @var string|null */ protected $password; /** * Password before encryption. Used for model validation. Must not be persisted. + * * @var string|null */ protected $plainPassword; - /** - * @var \DateTimeInterface|null - */ + /** @var \DateTimeInterface|null */ protected $lastLogin; /** * Random string sent to the user email address in order to verify it + * * @var string|null */ protected $emailVerificationToken; /** * Random string sent to the user email address in order to verify the password resetting request + * * @var string|null */ protected $passwordResetToken; - /** - * @var \DateTimeInterface|null - */ + /** @var \DateTimeInterface|null */ protected $passwordRequestedAt; - /** - * @var \DateTimeInterface|null - */ + /** @var \DateTimeInterface|null */ protected $verifiedAt; - /** - * @var bool - */ + /** @var bool */ protected $locked = false; - /** - * @var \DateTimeInterface|null - */ + /** @var \DateTimeInterface|null */ protected $expiresAt; - /** - * @var \DateTimeInterface|null - */ + /** @var \DateTimeInterface|null */ protected $credentialsExpireAt; /** * We need at least one role to be able to authenticate + * * @var mixed[] */ protected $roles = [UserInterface::DEFAULT_ROLE]; @@ -109,19 +102,13 @@ class User implements UserInterface, \Stringable */ protected $oauthAccounts; - /** - * @var string|null - */ + /** @var string|null */ protected $email; - /** - * @var string|null - */ + /** @var string|null */ protected $emailCanonical; - /** - * @var string|null - */ + /** @var string|null */ protected $encoderName; public function __construct() diff --git a/src/Sylius/Component/User/Model/UserOAuth.php b/src/Sylius/Component/User/Model/UserOAuth.php index 2cd79b63933..cfe89e2063f 100644 --- a/src/Sylius/Component/User/Model/UserOAuth.php +++ b/src/Sylius/Component/User/Model/UserOAuth.php @@ -18,29 +18,19 @@ class UserOAuth implements UserOAuthInterface /** @var mixed */ protected $id; - /** - * @var string|null - */ + /** @var string|null */ protected $provider; - /** - * @var string|null - */ + /** @var string|null */ protected $identifier; - /** - * @var string|null - */ + /** @var string|null */ protected $accessToken; - /** - * @var string|null - */ + /** @var string|null */ protected $refreshToken; - /** - * @var UserInterface|null - */ + /** @var UserInterface|null */ protected $user; public function getId()