From 2bef7591fe41ad2a46d107d506b46dae04c1bb5e Mon Sep 17 00:00:00 2001 From: webeweb Date: Tue, 28 Mar 2023 14:16:28 +0200 Subject: [PATCH] Code checkstyle --- Resources/config/controllers.yml | 2 +- Tests/AbstractTestCase.php | 17 ++++++++++------- Tests/Fixtures/app/TestKernel.php | 2 +- Tests/Fixtures/app/config/services_test.yml | 2 +- WBWSmsModeBundle.php | 4 ++-- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Resources/config/controllers.yml b/Resources/config/controllers.yml index a35a6e3..ac53389 100644 --- a/Resources/config/controllers.yml +++ b/Resources/config/controllers.yml @@ -6,7 +6,7 @@ services: public: true wbw.smsmode.controller.default: - class: WBW\Bundle\SmsModeBundle\Controller\DefaultController + class: WBW\Bundle\SmsModeBundle\Controller\DefaultController public: true calls: - [ "setContainer", [ "@service_container" ] ] diff --git a/Tests/AbstractTestCase.php b/Tests/AbstractTestCase.php index a387f78..14373a6 100644 --- a/Tests/AbstractTestCase.php +++ b/Tests/AbstractTestCase.php @@ -13,6 +13,9 @@ use DateTime; use WBW\Bundle\CoreBundle\Tests\AbstractTestCase as BaseTestCase; +use WBW\Library\SmsMode\Api\SendingSmsBatchInterface as ApiSendingSmsBatchInterface; +use WBW\Library\SmsMode\Api\SendingSmsMessageInterface as ApiSendingSmsMessageInterface; +use WBW\Library\SmsMode\Api\SendingTextToSpeechSmsInterface as ApiSendingTextToSpeechSmsInterface; use WBW\Library\SmsMode\Entity\AddingContactInterface; use WBW\Library\SmsMode\Entity\CheckingSmsMessageStatusInterface; use WBW\Library\SmsMode\Entity\CreatingSubAccountInterface; @@ -144,7 +147,7 @@ abstract class AbstractTestCase extends BaseTestCase { protected function setUp(): void { parent::setUp(); - // Set a Fichier mock. + // Set a fichier mock. $this->fichier = realpath(__DIR__ . "/../vendor/webeweb/smsmode-library/tests/Fixtures/Request/SendingSmsBatchRequest.csv"); // Set an Adding contact mock. @@ -200,7 +203,7 @@ protected function setUp(): void { // Set a Sending SMS batch mock. $this->sendingSmsBatch = $this->getMockBuilder(SendingSmsBatchInterface::class)->getMock(); - $this->sendingSmsBatch->expects($this->any())->method("getSmsModeClasseMsg")->willReturn(SendingSmsBatchRequest::CLASSE_MSG_SMS); + $this->sendingSmsBatch->expects($this->any())->method("getSmsModeClasseMsg")->willReturn(ApiSendingSmsBatchInterface::CLASSE_MSG_SMS); $this->sendingSmsBatch->expects($this->any())->method("getSmsModeDateEnvoi")->willReturn(new DateTime("2019-02-05 18:00:00")); $this->sendingSmsBatch->expects($this->any())->method("getSmsModeEmetteur")->willReturn("emetteur"); $this->sendingSmsBatch->expects($this->any())->method("getSmsModeFichier")->willReturn($this->fichier); @@ -210,7 +213,7 @@ protected function setUp(): void { // Set a Sending SMS message mock. $this->sendingSmsMessage = $this->getMockBuilder(SendingSmsMessageInterface::class)->getMock(); - $this->sendingSmsMessage->expects($this->any())->method("getSmsModeClasseMsg")->willReturn(SendingSmsMessageRequest::CLASSE_MSG_SMS); + $this->sendingSmsMessage->expects($this->any())->method("getSmsModeClasseMsg")->willReturn(ApiSendingSmsBatchInterface::CLASSE_MSG_SMS); $this->sendingSmsMessage->expects($this->any())->method("getSmsModeDateEnvoi")->willReturn(new DateTime("2019-02-05 18:00:00")); $this->sendingSmsMessage->expects($this->any())->method("getSmsModeEmetteur")->willReturn("emetteur"); $this->sendingSmsMessage->expects($this->any())->method("getSmsModeGroupe")->willReturn("groupe"); @@ -220,19 +223,19 @@ protected function setUp(): void { $this->sendingSmsMessage->expects($this->any())->method("getSmsModeNotificationUrlReponse")->willReturn("notificationUrlReponse"); $this->sendingSmsMessage->expects($this->any())->method("getSmsModeNumero")->willReturn(["33600000000"]); $this->sendingSmsMessage->expects($this->any())->method("getSmsModeRefClient")->willReturn("refClient"); - $this->sendingSmsMessage->expects($this->any())->method("getSmsModeStop")->willReturn(SendingSmsMessageRequest::STOP_ALWAYS); + $this->sendingSmsMessage->expects($this->any())->method("getSmsModeStop")->willReturn(ApiSendingSmsMessageInterface::STOP_ALWAYS); // Set a Sending text-to-speech SMS mock. $this->sendingTextToSpeechSms = $this->getMockBuilder(SendingTextToSpeechSmsInterface::class)->getMock(); $this->sendingTextToSpeechSms->expects($this->any())->method("getSmsModeDateEnvoi")->willReturn(new DateTime("2019-02-05 18:00:00")); $this->sendingTextToSpeechSms->expects($this->any())->method("getSmsModeMessage")->willReturn("message"); $this->sendingTextToSpeechSms->expects($this->any())->method("getSmsModeNumero")->willReturn(["33600000000"]); - $this->sendingTextToSpeechSms->expects($this->any())->method("getSmsModeLanguage")->willReturn(SendingTextToSpeechSmsRequest::LANGUAGE_FR); + $this->sendingTextToSpeechSms->expects($this->any())->method("getSmsModeLanguage")->willReturn(ApiSendingTextToSpeechSmsInterface::LANGUAGE_FR); $this->sendingTextToSpeechSms->expects($this->any())->method("getSmsModeTitle")->willReturn("title"); // Set a Sending unicode SMS mock. $this->sendingUnicodeSms = $this->getMockBuilder(SendingUnicodeSmsInterface::class)->getMock(); - $this->sendingUnicodeSms->expects($this->any())->method("getSmsModeClasseMsg")->willReturn(SendingUnicodeSmsRequest::CLASSE_MSG_SMS); + $this->sendingUnicodeSms->expects($this->any())->method("getSmsModeClasseMsg")->willReturn(ApiSendingSmsBatchInterface::CLASSE_MSG_SMS); $this->sendingUnicodeSms->expects($this->any())->method("getSmsModeDateEnvoi")->willReturn(new DateTime("2019-02-05 18:00:00")); $this->sendingUnicodeSms->expects($this->any())->method("getSmsModeEmetteur")->willReturn("emetteur"); $this->sendingUnicodeSms->expects($this->any())->method("getSmsModeGroupe")->willReturn("groupe"); @@ -242,7 +245,7 @@ protected function setUp(): void { $this->sendingUnicodeSms->expects($this->any())->method("getSmsModeNotificationUrlReponse")->willReturn("notificationUrlReponse"); $this->sendingUnicodeSms->expects($this->any())->method("getSmsModeNumero")->willReturn(["33600000000"]); $this->sendingUnicodeSms->expects($this->any())->method("getSmsModeRefClient")->willReturn("refClient"); - $this->sendingUnicodeSms->expects($this->any())->method("getSmsModeStop")->willReturn(SendingSmsMessageRequest::STOP_ALWAYS); + $this->sendingUnicodeSms->expects($this->any())->method("getSmsModeStop")->willReturn(ApiSendingSmsMessageInterface::STOP_ALWAYS); // Set a Sent SMS message list mock. $this->sentSmsMessageList = $this->getMockBuilder(SentSmsMessageListInterface::class)->getMock(); diff --git a/Tests/Fixtures/app/TestKernel.php b/Tests/Fixtures/app/TestKernel.php index 15514f6..7860b1f 100644 --- a/Tests/Fixtures/app/TestKernel.php +++ b/Tests/Fixtures/app/TestKernel.php @@ -25,7 +25,7 @@ class TestKernel extends AbstractKernel { */ public function registerBundles(): array { - return [ + return [ new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\MonologBundle\MonologBundle(), new Symfony\Bundle\SecurityBundle\SecurityBundle(), diff --git a/Tests/Fixtures/app/config/services_test.yml b/Tests/Fixtures/app/config/services_test.yml index 8f607df..dc8b628 100644 --- a/Tests/Fixtures/app/config/services_test.yml +++ b/Tests/Fixtures/app/config/services_test.yml @@ -2,7 +2,7 @@ services: wbw.smsmode.event_listener: - class: WBW\Bundle\SmsModeBundle\Tests\Fixtures\EventListener\TestEventListener + class: WBW\Bundle\SmsModeBundle\Tests\Fixtures\EventListener\TestEventListener public: true tags: - { name: "kernel.event_listener", event: "wbw.smsmode.event.delivery_report_callback", method: "onDeliveryReportCallback" } diff --git a/WBWSmsModeBundle.php b/WBWSmsModeBundle.php index ff65754..943ed0d 100644 --- a/WBWSmsModeBundle.php +++ b/WBWSmsModeBundle.php @@ -11,7 +11,7 @@ namespace WBW\Bundle\SmsModeBundle; -use Symfony\Component\DependencyInjection\Extension\Extension; +use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; use Symfony\Component\HttpKernel\Bundle\Bundle; use WBW\Bundle\SmsModeBundle\DependencyInjection\WBWSmsModeExtension; @@ -26,7 +26,7 @@ class WBWSmsModeBundle extends Bundle { /** * {@inheritdoc} */ - public function getContainerExtension(): Extension { + public function getContainerExtension(): ExtensionInterface { return new WBWSmsModeExtension(); } }