diff --git a/.dev-tools/composer.json b/.dev-tools/composer.json index 5dcb661..f21153f 100644 --- a/.dev-tools/composer.json +++ b/.dev-tools/composer.json @@ -16,6 +16,11 @@ "url": "https://github.com/magento/magento2.git" } ], + "scripts": { + "cs:fixer": "./vendor/bin/php-cs-fixer fix -vvv --diff", + "cs:phpstan": "./vendor/bin/phpstan", + "cs:psalm": "./vendor/bin/psalm" + }, "config": { "allow-plugins": { "ergebnis/composer-normalize": true, diff --git a/.github/workflows/sca.yaml b/.github/workflows/sca.yaml index d4ac436..2161e92 100644 --- a/.github/workflows/sca.yaml +++ b/.github/workflows/sca.yaml @@ -25,10 +25,10 @@ jobs: run: composer normalize --diff --dry-run --indent-size=4 --indent-style=space ../composer.json - working-directory: .dev-tools - run: ./vendor/bin/php-cs-fixer fix -vvv --diff --dry-run + run: composer cs:fixer -- --dry-run - working-directory: .dev-tools - run: ./vendor/bin/phpstan + run: composer cs:phpstan - working-directory: .dev-tools - run: ./vendor/bin/psalm --no-progress --shepherd + run: composer cs:psalm -- --no-progress --shepherd diff --git a/Model/ApiFacade/CardTransaction/CardApiFacade.php b/Model/ApiFacade/CardTransaction/CardApiFacade.php index 8dad2f8..867894b 100755 --- a/Model/ApiFacade/CardTransaction/CardApiFacade.php +++ b/Model/ApiFacade/CardTransaction/CardApiFacade.php @@ -41,7 +41,7 @@ private function getCurrent() private function createOpenApiInstance(TpayInterface $tpay, TpayTokensService $tokensService, TpayService $tpayService) { - if ($this->storeManager->getStore()->getCurrentCurrencyCode() !== 'PLN') { + if ('PLN' !== $this->storeManager->getStore()->getCurrentCurrencyCode()) { $this->cardOpen = null; $this->useOpenCard = false; diff --git a/Model/ApiFacade/TpayConfig/ConfigFacade.php b/Model/ApiFacade/TpayConfig/ConfigFacade.php index 28f9535..f4fceb2 100755 --- a/Model/ApiFacade/TpayConfig/ConfigFacade.php +++ b/Model/ApiFacade/TpayConfig/ConfigFacade.php @@ -37,7 +37,7 @@ private function getCurrentApi() private function createOpenApiInstance(TpayInterface $tpay, Repository $assetRepository, TpayTokensService $tokensService, StoreManagerInterface $storeManager) { - if ($storeManager->getStore()->getCurrentCurrencyCode() !== 'PLN') { + if ('PLN' !== $storeManager->getStore()->getCurrentCurrencyCode()) { $this->openApi = null; $this->useOpenApi = false; diff --git a/Model/GenericPaymentPlugin.php b/Model/GenericPaymentPlugin.php index 3094276..afcdd4f 100644 --- a/Model/GenericPaymentPlugin.php +++ b/Model/GenericPaymentPlugin.php @@ -13,7 +13,7 @@ public function beforeImportData(Payment $compiled, array $data): array $data['channel'] = explode('-', $data['method'])[1]; $data['method'] = TpayInterface::CODE; } - if ($data['method'] == 'tpaycom_magento2basic_cards') { + if ('tpaycom_magento2basic_cards' == $data['method']) { $data['method'] = TpayInterface::CODE; } diff --git a/Model/MethodListPlugin.php b/Model/MethodListPlugin.php index 2e46a81..7c9e412 100644 --- a/Model/MethodListPlugin.php +++ b/Model/MethodListPlugin.php @@ -64,12 +64,12 @@ public function getMethodInstance(string $title, string $code): MethodInterface private function filterResult(array $result): array { - if ($this->storeManager->getStore()->getCurrentCurrencyCode() === 'PLN') { + if ('PLN' === $this->storeManager->getStore()->getCurrentCurrencyCode()) { return $result; } return array_filter($result, function ($method) { - return $method->getCode() !== 'tpaycom_magento2basic'; + return 'tpaycom_magento2basic' !== $method->getCode(); }); } }