diff --git a/spec/EmailSender/SenderSpec.php b/spec/EmailSender/SenderSpec.php index 142b342..dc67cc7 100644 --- a/spec/EmailSender/SenderSpec.php +++ b/spec/EmailSender/SenderSpec.php @@ -1,9 +1,10 @@ beConstructedWith( $rendererAdapter, $senderAdapter, $provider, $defaultSettingsProvider, - $templateTranslationRepository + $templateTranslationRepository, ); $this->shouldHaveType(Sender::class); } @@ -60,7 +61,7 @@ function it_should_send_email( DefaultSettingsProviderInterface $defaultSettingsProvider, EmailTemplateTranslationRepositoryInterface $templateTranslationRepository, EmailInterface $email, - RenderedEmail $renderedEmail + RenderedEmail $renderedEmail, ): void { $this->beConstructedWith( $rendererAdapter, @@ -102,7 +103,7 @@ function it_should_set_custom_email_template_if_found( DefaultSettingsProviderInterface $defaultSettingsProvider, EmailTemplateTranslationRepositoryInterface $templateTranslationRepository, EmailInterface $email, - RenderedEmail $renderedEmail + RenderedEmail $renderedEmail, ): void { $this->beConstructedWith( $rendererAdapter, @@ -122,7 +123,7 @@ function it_should_set_custom_email_template_if_found( $emailTemplateTranslation = new EmailTemplateTranslation(); $templateTranslationRepository->findOneByLocaleCodeAndType( self::LOCALE, - self::EMAIL_TYPE + self::EMAIL_TYPE, )->willReturn($emailTemplateTranslation); $rendererAdapter->render($email, Argument::type('array'))->willReturn($renderedEmail); diff --git a/spec/EventListener/NotFoundTypeCreateEmailTemplateEventListenerSpec.php b/spec/EventListener/NotFoundTypeCreateEmailTemplateEventListenerSpec.php index 3578df2..9454965 100644 --- a/spec/EventListener/NotFoundTypeCreateEmailTemplateEventListenerSpec.php +++ b/spec/EventListener/NotFoundTypeCreateEmailTemplateEventListenerSpec.php @@ -1,9 +1,10 @@ attributes = $attributes; @@ -47,7 +48,7 @@ function it_should_do_nothing_when_route_is_not_create_email_template( RequestEvent $requestEvent, Request $request, ParameterBag $attributes, - EmailCodesProviderInterface $emailCodesProvider + EmailCodesProviderInterface $emailCodesProvider, ): void { $requestEvent->getRequest()->willReturn($request); @@ -64,7 +65,7 @@ function it_should_not_redirect_when_type_are_available_to_create_email_template ParameterBag $attributes, EmailCodesProviderInterface $emailCodesProvider, Session $session, - FlashBagInterface $flashBag + FlashBagInterface $flashBag, ): void { $requestEvent->getRequest()->willReturn($request); @@ -90,7 +91,7 @@ function it_should_redirect_when_route_is_create_email_template( Session $session, FlashBagInterface $flashBag, RouterInterface $router, - DataCollectorTranslator $dataCollectorTranslator + DataCollectorTranslator $dataCollectorTranslator, ): void { $requestEvent->getRequest()->willReturn($request); diff --git a/spec/EventListener/TwigErrorEventListenerSpec.php b/spec/EventListener/TwigErrorEventListenerSpec.php index 970bd9c..9a850c0 100644 --- a/spec/EventListener/TwigErrorEventListenerSpec.php +++ b/spec/EventListener/TwigErrorEventListenerSpec.php @@ -1,9 +1,10 @@ getWrappedObject(), $request->getWrappedObject(), HttpKernelInterface::MASTER_REQUEST, - new \Exception() + new \Exception(), ); $customTwigErrorResponseProvider->provide(Argument::type(Error::class))->shouldNotBeCalled(); @@ -53,14 +54,14 @@ function it_should_do_nothing_if_exception_is_not_a_twig_security_error( function it_should_do_nothing_if_provided_custom_response_is_null( HttpKernelInterface $httpKernel, Request $request, - CustomTwigErrorResponseProviderInterface $customTwigErrorResponseProvider + CustomTwigErrorResponseProviderInterface $customTwigErrorResponseProvider, ): void { $genericResponse = new Response(); $exceptionEvent = new ExceptionEvent( $httpKernel->getWrappedObject(), $request->getWrappedObject(), HttpKernelInterface::MASTER_REQUEST, - new \Exception() + new \Exception(), ); $exceptionEvent->setResponse($genericResponse); $customTwigErrorResponseProvider->provide(Argument::type(Error::class))->willReturn(null); @@ -73,7 +74,7 @@ function it_should_do_nothing_if_provided_custom_response_is_null( function it_should_set_response_to_the_provided_custom_twig_error_response( HttpKernelInterface $httpKernel, Request $request, - CustomTwigErrorResponseProviderInterface $customTwigErrorResponseProvider + CustomTwigErrorResponseProviderInterface $customTwigErrorResponseProvider, ): void { $jsonResponse = new JsonResponse(); $error = new Error('foo'); @@ -81,7 +82,7 @@ function it_should_set_response_to_the_provided_custom_twig_error_response( $httpKernel->getWrappedObject(), $request->getWrappedObject(), HttpKernelInterface::MASTER_REQUEST, - $error + $error, ); $exceptionEvent->setResponse(new Response()); $customTwigErrorResponseProvider->provide($error)->willReturn($jsonResponse); diff --git a/spec/MailPreviewData/Factory/CustomerPreviewDataFactorySpec.php b/spec/MailPreviewData/Factory/CustomerPreviewDataFactorySpec.php index 97d2a91..a4bfed6 100644 --- a/spec/MailPreviewData/Factory/CustomerPreviewDataFactorySpec.php +++ b/spec/MailPreviewData/Factory/CustomerPreviewDataFactorySpec.php @@ -1,9 +1,10 @@ beConstructedWith( self::EXAMPLE_EMAILS_CONFIGURATION, $emailTemplateRepository, - $dataCollectorTranslator + $dataCollectorTranslator, ); } @@ -93,12 +100,12 @@ function it_should_return_not_email_template_types(EmailTemplateRepositoryInterf function it_should_return_not_used_types_for_edit_email_template( EmailTemplateRepositoryInterface $emailTemplateRepository, EmailTemplateInterface $emailTemplate, - DataCollectorTranslator $dataCollectorTranslator + DataCollectorTranslator $dataCollectorTranslator, ): void { $dataCollectorTranslator->trans( 'Contact Request', [], - EmailTemplateType::MAIL_TEMPLATE_TYPE_DOMAIN + EmailTemplateType::MAIL_TEMPLATE_TYPE_DOMAIN, )->shouldBeCalled()->willReturn('Contact Request'); $emailTemplateRepository->getAllTypes()->willReturn([ diff --git a/spec/Provider/MailPreviewDataProviderSpec.php b/spec/Provider/MailPreviewDataProviderSpec.php index 884e39e..64019ff 100644 --- a/spec/Provider/MailPreviewDataProviderSpec.php +++ b/spec/Provider/MailPreviewDataProviderSpec.php @@ -1,5 +1,12 @@ $genericMailPreviewData, @@ -60,7 +67,7 @@ function it_should_throw_exception_if_matched_mail_preview_data_is_not_implement function it_should_return_mail_preview_data_for_requested_type( MailPreviewDataInterface $genericMailPreviewData, - MailPreviewDataInterface $fooMailPreviewData + MailPreviewDataInterface $fooMailPreviewData, ): void { $availableMailPreviewData = [ MailPreviewDataProvider::GENERIC_PREVIEW_DATA_KEY => $genericMailPreviewData, diff --git a/spec/Repository/EmailTemplateTranslationRepositorySpec.php b/spec/Repository/EmailTemplateTranslationRepositorySpec.php index 0e9e3e1..3835783 100644 --- a/spec/Repository/EmailTemplateTranslationRepositorySpec.php +++ b/spec/Repository/EmailTemplateTranslationRepositorySpec.php @@ -1,9 +1,10 @@ createQueryBuilder('tt', null)->willReturn($queryBuilder); diff --git a/spec/Response/TwigError/SecurityNotAllowedFilterErrorResponseSpec.php b/spec/Response/TwigError/SecurityNotAllowedFilterErrorResponseSpec.php index 96b3833..e09cbd0 100644 --- a/spec/Response/TwigError/SecurityNotAllowedFilterErrorResponseSpec.php +++ b/spec/Response/TwigError/SecurityNotAllowedFilterErrorResponseSpec.php @@ -1,5 +1,12 @@ '*', @@ -51,7 +52,7 @@ function it_should_not_call_decorated_object_on_check_method_if_allowed_methods_ } function it_should_not_call_decorated_object_on_check_method_if_allowed_methods_contains__class_wildcard_with_matching_method( - SecurityPolicyInterface $securityPolicy + SecurityPolicyInterface $securityPolicy, ): void { $allowedMethods = [ '*' => [ @@ -65,7 +66,7 @@ function it_should_not_call_decorated_object_on_check_method_if_allowed_methods_ } function it_should_not_call_decorated_object_on_check_method_if_allowed_methods_contains_wildcard_class_with_wildcard_method( - SecurityPolicyInterface $securityPolicy + SecurityPolicyInterface $securityPolicy, ): void { $allowedMethods = [ '*' => '*', @@ -77,7 +78,7 @@ function it_should_not_call_decorated_object_on_check_method_if_allowed_methods_ } function it_should_call_decorated_object_method_on_check_method_if_passed_object_or_method_doesnt_meet_requirements( - SecurityPolicyInterface $securityPolicy + SecurityPolicyInterface $securityPolicy, ): void { $securityPolicy->checkMethodAllowed(Argument::type('object'), self::EXAMPLE_METHOD)->shouldBeCalled(); diff --git a/spec/Validator/IsRenderableMailContentValidatorSpec.php b/spec/Validator/IsRenderableMailContentValidatorSpec.php index f964884..e9281d6 100644 --- a/spec/Validator/IsRenderableMailContentValidatorSpec.php +++ b/spec/Validator/IsRenderableMailContentValidatorSpec.php @@ -1,5 +1,12 @@ createEmailTemplateTranslationWithSampleEmailTemplate(); @@ -69,7 +76,7 @@ function it_should_add_violation_if_exception_is_thrown_while_rendering( $constraint = new IsRenderableMailContent(); $validator = new IsRenderableMailContentValidator( $twig->getWrappedObject(), - $mailPreviewDataProvider->getWrappedObject() + $mailPreviewDataProvider->getWrappedObject(), ); $validator->initialize($context->getWrappedObject()); @@ -85,7 +92,7 @@ function it_should_do_nothing_if_no_exception_has_been_thrown_while_rendering( ExecutionContextInterface $context, environment $twig, MailPreviewDataProviderInterface $mailPreviewDataProvider, - MailPreviewDataInterface $mailPreviewData + MailPreviewDataInterface $mailPreviewData, ): void { $emailTemplateTranslation = $this->createEmailTemplateTranslationWithSampleEmailTemplate(); @@ -97,7 +104,7 @@ function it_should_do_nothing_if_no_exception_has_been_thrown_while_rendering( $twig->render(RenderEmailPreviewAction::EMAIL_PREVIEW_TEMPLATE, Argument::type('array')); $validator = new IsRenderableMailContentValidator( $twig->getWrappedObject(), - $mailPreviewDataProvider->getWrappedObject() + $mailPreviewDataProvider->getWrappedObject(), ); $validator->initialize($context->getWrappedObject()); diff --git a/src/BitBagSyliusMailTemplatePlugin.php b/src/BitBagSyliusMailTemplatePlugin.php index 0a270bf..7d40d1f 100644 --- a/src/BitBagSyliusMailTemplatePlugin.php +++ b/src/BitBagSyliusMailTemplatePlugin.php @@ -1,10 +1,11 @@ setParameter( self::ALLOWED_FILTERS_PARAMETER, - array_unique(array_merge($config[Configuration::TWIG][Configuration::ALLOWED_FILTERS], self::REQUIRED_FILTERS)) + array_unique(array_merge($config[Configuration::TWIG][Configuration::ALLOWED_FILTERS], self::REQUIRED_FILTERS)), ); $container->setParameter( self::ALLOWED_FUNCTIONS_PARAMETER, - array_unique(array_merge($config[Configuration::TWIG][Configuration::ALLOWED_FUNCTIONS], self::REQUIRED_FUNCTIONS)) + array_unique(array_merge($config[Configuration::TWIG][Configuration::ALLOWED_FUNCTIONS], self::REQUIRED_FUNCTIONS)), ); $container->setParameter( self::ALLOWED_METHODS_PARAMETER, - $config[Configuration::TWIG][Configuration::ALLOWED_METHODS] + $config[Configuration::TWIG][Configuration::ALLOWED_METHODS], ); $container->setParameter( self::ALLOWED_PROPERTIES_PARAMETER, - $config[Configuration::TWIG][Configuration::ALLOWED_PROPERTIES] + $config[Configuration::TWIG][Configuration::ALLOWED_PROPERTIES], ); $container->setParameter( self::ALLOWED_TAGS_PARAMETER, - array_unique(array_merge($config[Configuration::TWIG][Configuration::ALLOWED_TAGS], self::REQUIRED_TAGS)) + array_unique(array_merge($config[Configuration::TWIG][Configuration::ALLOWED_TAGS], self::REQUIRED_TAGS)), ); } diff --git a/src/DependencyInjection/CompilerPass/SyliusBehatPolyfillCompilerPass.php b/src/DependencyInjection/CompilerPass/SyliusBehatPolyfillCompilerPass.php index d1d55d9..a656a08 100644 --- a/src/DependencyInjection/CompilerPass/SyliusBehatPolyfillCompilerPass.php +++ b/src/DependencyInjection/CompilerPass/SyliusBehatPolyfillCompilerPass.php @@ -1,9 +1,10 @@ senderAdapter = $senderAdapter; $this->rendererAdapter = $rendererAdapter; @@ -55,7 +55,7 @@ public function send( array $recipients, array $data = [], array $attachments = [], - array $replyTo = [] + array $replyTo = [], ): void { $email = $this->provider->getEmail($code); @@ -65,7 +65,7 @@ public function send( $customTemplate = $this->templateTranslationRepository->findOneByLocaleCodeAndType( $data[self::LOCALE_CODE_KEY] ?? '', - $code + $code, ); if (null !== $customTemplate) { @@ -86,7 +86,7 @@ public function send( $email, $data, $attachments, - $replyTo + $replyTo, ); } } diff --git a/src/EmailSender/SenderInterface.php b/src/EmailSender/SenderInterface.php index 4b43639..0da14ac 100644 --- a/src/EmailSender/SenderInterface.php +++ b/src/EmailSender/SenderInterface.php @@ -18,6 +18,6 @@ public function send( array $recipients, array $data = [], array $attachments = [], - array $replyTo = [] + array $replyTo = [], ): void; } diff --git a/src/Entity/EmailTemplate.php b/src/Entity/EmailTemplate.php index 66db9b6..f31c669 100644 --- a/src/Entity/EmailTemplate.php +++ b/src/Entity/EmailTemplate.php @@ -1,10 +1,11 @@ emailCodesProvider = $emailCodesProvider; $this->translator = $translator; diff --git a/src/EventListener/TwigErrorEventListener.php b/src/EventListener/TwigErrorEventListener.php index ae04230..8baeb40 100644 --- a/src/EventListener/TwigErrorEventListener.php +++ b/src/EventListener/TwigErrorEventListener.php @@ -1,9 +1,10 @@ emailTemplateFactory = $emailTemplateFactory; $this->emailTemplateTranslationFactory = $emailTemplateTranslationFactory; @@ -57,7 +57,7 @@ public function load(array $options): void private function createEmailTemplate( string $type, string $styleCss, - array $emailTemplateData + array $emailTemplateData, ): void { /** @var EmailTemplateInterface $emailTemplate */ $emailTemplate = $this->emailTemplateFactory->createNew(); diff --git a/src/Form/Type/EmailTemplateType.php b/src/Form/Type/EmailTemplateType.php index 7f8d940..3a922a4 100644 --- a/src/Form/Type/EmailTemplateType.php +++ b/src/Form/Type/EmailTemplateType.php @@ -1,10 +1,11 @@ emails = $emails; $this->emailTemplateRepository = $emailTemplateRepository; @@ -74,7 +75,7 @@ public function getAvailableEmailTemplateTypes(EmailTemplateInterface $emailTemp $translatedLabelName = $this->dataCollectorTranslator->trans( $labelName, [], - EmailTemplateType::MAIL_TEMPLATE_TYPE_DOMAIN + EmailTemplateType::MAIL_TEMPLATE_TYPE_DOMAIN, ); $types[$translatedLabelName] = $dataType; diff --git a/src/Provider/EmailCodesProviderInterface.php b/src/Provider/EmailCodesProviderInterface.php index c83dc7d..4a7f11d 100644 --- a/src/Provider/EmailCodesProviderInterface.php +++ b/src/Provider/EmailCodesProviderInterface.php @@ -1,9 +1,10 @@ select('et.type') ->getQuery() ->getResult() - ; + ; } } diff --git a/src/Repository/EmailTemplateRepositoryInterface.php b/src/Repository/EmailTemplateRepositoryInterface.php index 7afee5a..b1a7e8e 100644 --- a/src/Repository/EmailTemplateRepositoryInterface.php +++ b/src/Repository/EmailTemplateRepositoryInterface.php @@ -1,10 +1,11 @@ decoratedRepository->findBy($criteria, $orderBy, $limit, $offset); } diff --git a/src/Request/MailPreviewRequest.php b/src/Request/MailPreviewRequest.php index db479a3..ebde15c 100644 --- a/src/Request/MailPreviewRequest.php +++ b/src/Request/MailPreviewRequest.php @@ -1,9 +1,10 @@ name = $name; $this->subject = $subject; diff --git a/src/Request/RequestDtoInterface.php b/src/Request/RequestDtoInterface.php index 59536c8..58fa7f0 100644 --- a/src/Request/RequestDtoInterface.php +++ b/src/Request/RequestDtoInterface.php @@ -1,9 +1,10 @@ $this->getErrorMessage($error), ], - Response::HTTP_BAD_REQUEST + Response::HTTP_BAD_REQUEST, ); } diff --git a/src/Response/TwigError/SecurityNotAllowedFilterErrorResponse.php b/src/Response/TwigError/SecurityNotAllowedFilterErrorResponse.php index ffd9850..094c9c7 100644 --- a/src/Response/TwigError/SecurityNotAllowedFilterErrorResponse.php +++ b/src/Response/TwigError/SecurityNotAllowedFilterErrorResponse.php @@ -1,9 +1,10 @@ decoratedSecurityPolicy->checkSecurity($tags, $filters, $functions); } diff --git a/src/Validator/IsRenderableMailContent.php b/src/Validator/IsRenderableMailContent.php index 8a9e06d..3188731 100644 --- a/src/Validator/IsRenderableMailContent.php +++ b/src/Validator/IsRenderableMailContent.php @@ -1,9 +1,10 @@ sharedStorage = $sharedStorage; $this->templateFactory = $templateFactory; @@ -47,7 +47,7 @@ public function thereIsMailTemplateWithTypeAndNameAndSubjectAndContent( string $type, string $name, string $subject, - string $content + string $content, ): void { $emailTemplate = $this->createEmailTemplate($type, $name, $subject, $content); @@ -62,7 +62,7 @@ public function thereIsMailTemplateWithTypeAndNameAndSubjectAndContentAndLocale( string $name, string $subject, string $content, - string $locale + string $locale, ): void { $emailTemplate = $this->createEmailTemplate($type, $name, $subject, $content, $locale); @@ -74,7 +74,7 @@ private function createEmailTemplate( ?string $name = null, ?string $subject = null, ?string $content = null, - ?string $locale = null + ?string $locale = null, ): EmailTemplateInterface { /** @var EmailTemplateTranslationInterface $emailTemplateTranslation */ $emailTemplateTranslation = $this->templateTranslationFactory->createNew(); diff --git a/tests/Behat/Context/Ui/Admin/EmailTemplateContext.php b/tests/Behat/Context/Ui/Admin/EmailTemplateContext.php index 813c15e..cc8ebf9 100644 --- a/tests/Behat/Context/Ui/Admin/EmailTemplateContext.php +++ b/tests/Behat/Context/Ui/Admin/EmailTemplateContext.php @@ -1,9 +1,10 @@ createPage = $createPage; $this->notificationChecker = $notificationChecker; @@ -88,7 +89,7 @@ public function iShouldBeNotifiedThatTheEmailTemplateHasBeenSuccessfullyCreated( { $this->notificationChecker->checkNotification( 'Email template has been successfully created.', - NotificationType::success() + NotificationType::success(), ); } diff --git a/tests/Behat/Context/Ui/EmailTemplateContext.php b/tests/Behat/Context/Ui/EmailTemplateContext.php index 1ae48bb..11bba3d 100644 --- a/tests/Behat/Context/Ui/EmailTemplateContext.php +++ b/tests/Behat/Context/Ui/EmailTemplateContext.php @@ -18,7 +18,6 @@ use Sylius\Component\Core\Model\OrderInterface; use Sylius\Component\Core\Model\ShipmentInterface; use Sylius\Component\Core\Model\ShippingMethodInterface; -use Symfony\Component\Routing\Exception\ResourceNotFoundException; use Webmozart\Assert\Assert; final class EmailTemplateContext implements Context @@ -29,7 +28,7 @@ final class EmailTemplateContext implements Context public function __construct( SharedStorageInterface $sharedStorage, - EmailCheckerInterface $emailChecker + EmailCheckerInterface $emailChecker, ) { $this->sharedStorage = $sharedStorage; $this->emailChecker = $emailChecker; @@ -52,9 +51,9 @@ public function aCustomEmailShouldBeSentTo(string $recipient, string $sender): v sprintf( '%s wrote %s', $sender, - 'Hi! I did not receive an item!' + 'Hi! I did not receive an item!', ), - $recipient + $recipient, ); } @@ -69,9 +68,9 @@ public function aDefaultEmailShouldBeSentTo(string $recipient, string $sender): 'Message from', $sender, 'Content', - 'Hi! I did not receive an item!' + 'Hi! I did not receive an item!', ), - $recipient + $recipient, ); } @@ -83,7 +82,7 @@ public function aDefaultEmailWithResetTokenShouldBeSentTo(string $recipient, str { $this->assertEmailContainsMessageTo( 'To reset your password - click the link below', - $recipient + $recipient, ); } @@ -95,7 +94,7 @@ public function aCustomEmailWithResetTokenShouldBeSentTo(string $recipient, stri { $this->assertEmailContainsMessageTo( 'Wanna reset password? Here is your code:', - $recipient + $recipient, ); } @@ -105,15 +104,15 @@ public function aCustomEmailWithResetTokenShouldBeSentTo(string $recipient, stri public function anEmailWithShipmentsConfirmationForTheOrderShouldBeSentTo( string $method, string $orderNumber, - string $recipient + string $recipient, ): void { Assert::true($this->emailChecker->hasMessageTo( sprintf( 'Your order with number %s has been sent using %s.', $orderNumber, - $method + $method, ), - $recipient + $recipient, )); } @@ -124,7 +123,7 @@ public function aDefaultAccountVerificationEmailShouldHaveBeenSentTo(string $rec { $this->assertEmailContainsMessageTo( 'To verify your email address - click the link below', - $recipient + $recipient, ); } @@ -135,7 +134,7 @@ public function aCustomAccountVerificationEmailShouldHaveBeenSentTo(string $reci { $this->assertEmailContainsMessageTo( 'Verify yourself. We need you!', - $recipient + $recipient, ); } @@ -155,7 +154,7 @@ public function aWelcomingEmailShouldHaveBeenSentTo(string $recipient, string $l { $this->assertEmailContainsMessageTo( 'Enjoy our stuff!', - $recipient + $recipient, ); } @@ -167,7 +166,7 @@ public function aDefaultWelcomingEmailShouldHaveBeenSentTo(string $recipient, st { $this->assertEmailContainsMessageTo( 'You have just been registered. Thank you', - $recipient + $recipient, ); } @@ -178,15 +177,15 @@ public function aDefaultWelcomingEmailShouldHaveBeenSentTo(string $recipient, st public function anEmailWithTheConfirmationOfTheOrderShouldBeSentTo( OrderInterface $order, string $recipient, - string $localeCode = 'en_US' + string $localeCode = 'en_US', ): void { $this->assertEmailContainsMessageTo( sprintf( '%s %s', 'Pif paf', - $order->getNumber() + $order->getNumber(), ), - $recipient + $recipient, ); } @@ -197,16 +196,16 @@ public function anEmailWithTheConfirmationOfTheOrderShouldBeSentTo( public function aDefaultEmailWithTheConfirmationOfTheOrderShouldBeSentTo( OrderInterface $order, string $recipient, - string $localeCode = 'en_US' + string $localeCode = 'en_US', ): void { $this->assertEmailContainsMessageTo( sprintf( '%s %s %s', 'Your order no.', $order->getNumber(), - 'has been successfully placed.' + 'has been successfully placed.', ), - $recipient + $recipient, ); } @@ -251,11 +250,11 @@ public function aDefaultEmailWithSummaryOfOrderPlacedByShouldBeSentTo(OrderInter public function aDefaultEmailWithShipmentDetailsOfOrderShouldBeSentTo( OrderInterface $order, string $recipient, - string $localeCode = 'en_US' + string $localeCode = 'en_US', ): void { $this->assertEmailContainsMessageTo( 'Thank you for a successful transaction.', - $recipient + $recipient, ); } @@ -268,22 +267,22 @@ public function aDefaultEmailWithShipmentDetailsOfOrderShouldBeSentTo( public function anEmailWithShipmentDetailsOfOrderShouldBeSentTo( OrderInterface $order, string $recipient, - string $localeCode = 'en_US' + string $localeCode = 'en_US', ): void { $this->assertEmailContainsMessageTo( sprintf( '%s %s %s', 'Enjoy your new stuff!', $order->getNumber(), - $this->getShippingMethodName($order) + $this->getShippingMethodName($order), ), - $recipient + $recipient, ); if ($this->sharedStorage->has('tracking_code')) { $this->assertEmailContainsMessageTo( $this->sharedStorage->get('tracking_code'), - $recipient + $recipient, ); } } @@ -306,6 +305,7 @@ private function getShippingMethodName(OrderInterface $order): string Assert::notNull($shippingMethod); Assert::notNull($shippingMethod->getName()); + return $shippingMethod->getName(); } } diff --git a/tests/Behat/Context/Ui/LoginContext.php b/tests/Behat/Context/Ui/LoginContext.php index a5ac491..92544cb 100644 --- a/tests/Behat/Context/Ui/LoginContext.php +++ b/tests/Behat/Context/Ui/LoginContext.php @@ -54,7 +54,7 @@ public function __construct( WellKnownPasswordChangePageInterface $wellKnownPasswordChangePage, RegisterElementInterface $registerElement, NotificationCheckerInterface $notificationChecker, - CurrentPageResolverInterface $currentPageResolver + CurrentPageResolverInterface $currentPageResolver, ) { $this->homePage = $homePage; $this->loginPage = $loginPage; @@ -255,7 +255,7 @@ public function iShouldBeNotifiedThatEmailWithResetInstructionWasSent(): void { $this->notificationChecker->checkNotification( 'If the email you have specified exists in our system, we have sent there an instruction on how to reset your password.', - NotificationType::success() + NotificationType::success(), ); } @@ -296,7 +296,7 @@ public function iShouldBeNotifiedThatTheEnteredPasswordsDoNotMatch(): void { Assert::true($this->resetPasswordPage->checkValidationMessageFor( 'password', - 'The entered passwords don\'t match' + 'The entered passwords don\'t match', )); } @@ -307,7 +307,7 @@ public function iShouldBeNotifiedThatThePasswordShouldBeAtLeastCharactersLong(): { Assert::true($this->resetPasswordPage->checkValidationMessageFor( 'password', - 'Password must be at least 4 characters long.' + 'Password must be at least 4 characters long.', )); } diff --git a/tests/Behat/Element/Admin/PreviewModalElement.php b/tests/Behat/Element/Admin/PreviewModalElement.php index 108f58e..458b366 100644 --- a/tests/Behat/Element/Admin/PreviewModalElement.php +++ b/tests/Behat/Element/Admin/PreviewModalElement.php @@ -1,9 +1,10 @@ getDriver()->executeScript( - sprintf('document.querySelector("[name=\'%s\']").value = "%s";', $field, $value) + sprintf('document.querySelector("[name=\'%s\']").value = "%s";', $field, $value), ); } diff --git a/tests/Behat/Page/Admin/EmailTemplate/CreatePageInterface.php b/tests/Behat/Page/Admin/EmailTemplate/CreatePageInterface.php index df70acd..3113877 100644 --- a/tests/Behat/Page/Admin/EmailTemplate/CreatePageInterface.php +++ b/tests/Behat/Page/Admin/EmailTemplate/CreatePageInterface.php @@ -1,9 +1,10 @@ emailCodesProvider->provideWithLabelsNotUsedTypes()) + count($this->emailCodesProvider->provideWithLabelsNotUsedTypes()), ); } }