From c4430fb7daeaa241bf0476812c506ee74b059153 Mon Sep 17 00:00:00 2001 From: Petar Date: Wed, 4 May 2022 10:00:55 +0200 Subject: [PATCH 1/2] Add support for 2.4.4 --- .github/workflows/integration.yml | 46 +++++++++++++++++++++++-------- composer.json | 2 +- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index e8bcfbc..6211dbe 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -23,58 +23,80 @@ jobs: options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - uses: actions/checkout@v2 - - name: M2 Integration Tests with Magento 2 Version 2.3.7-p1 (PHP 7.3) + - name: M2 Integration Tests with Magento 2 Version 2.3.7-p2 (PHP 7.3) uses: extdn/github-actions-m2/magento-integration-tests/7.3@master with: module_name: CustomGento_CliTaxEditor composer_name: customgento/module-cli-tax-editor-m2 - ce_version: '2.3.7-p1' + ce_version: '2.3.7-p2' - uses: actions/checkout@v2 - - name: M2 Integration Tests with Magento 2 Version 2.3.7-p1 (PHP 7.4) + - name: M2 Integration Tests with Magento 2 Version 2.3.7-p2 (PHP 7.4) uses: extdn/github-actions-m2/magento-integration-tests/7.4@master with: module_name: CustomGento_CliTaxEditor composer_name: customgento/module-cli-tax-editor-m2 - ce_version: '2.3.7-p1' + ce_version: '2.3.7-p2' - uses: actions/checkout@v2 - - name: M2 Integration Tests with Magento 2 Version 2.3.7-p2 (PHP 7.3) + - name: M2 Integration Tests with Magento 2 Version 2.3.7-p3 (PHP 7.3) uses: extdn/github-actions-m2/magento-integration-tests/7.3@master with: module_name: CustomGento_CliTaxEditor composer_name: customgento/module-cli-tax-editor-m2 - ce_version: '2.3.7-p2' + ce_version: '2.3.7-p3' - uses: actions/checkout@v2 - - name: M2 Integration Tests with Magento 2 Version 2.3.7-p2 (PHP 7.4) + - name: M2 Integration Tests with Magento 2 Version 2.3.7-p3 (PHP 7.4) uses: extdn/github-actions-m2/magento-integration-tests/7.4@master with: module_name: CustomGento_CliTaxEditor composer_name: customgento/module-cli-tax-editor-m2 - ce_version: '2.3.7-p2' + ce_version: '2.3.7-p3' - uses: actions/checkout@v2 - - name: M2 Integration Tests with Magento 2 Version 2.4.3 (PHP 7.3) + - name: M2 Integration Tests with Magento 2 Version 2.4.3 (PHP 7.3) uses: extdn/github-actions-m2/magento-integration-tests/7.3@master with: module_name: CustomGento_CliTaxEditor composer_name: customgento/module-cli-tax-editor-m2 ce_version: '2.4.3' - uses: actions/checkout@v2 - - name: M2 Integration Tests with Magento 2 Version 2.4.3 (PHP 7.4) + - name: M2 Integration Tests with Magento 2 Version 2.4.3 (PHP 7.4) uses: extdn/github-actions-m2/magento-integration-tests/7.4@master with: module_name: CustomGento_CliTaxEditor composer_name: customgento/module-cli-tax-editor-m2 ce_version: '2.4.3' - uses: actions/checkout@v2 - - name: M2 Integration Tests with Magento 2 Version 2.4.3-p1 (PHP 7.3) + - name: M2 Integration Tests with Magento 2 Version 2.4.3-p1 (PHP 7.3) uses: extdn/github-actions-m2/magento-integration-tests/7.3@master with: module_name: CustomGento_CliTaxEditor composer_name: customgento/module-cli-tax-editor-m2 ce_version: '2.4.3-p1' - uses: actions/checkout@v2 - - name: M2 Integration Tests with Magento 2 Version 2.4.3-p1 (PHP 7.4) + - name: M2 Integration Tests with Magento 2 Version 2.4.3-p1 (PHP 7.4) uses: extdn/github-actions-m2/magento-integration-tests/7.4@master with: module_name: CustomGento_CliTaxEditor composer_name: customgento/module-cli-tax-editor-m2 ce_version: '2.4.3-p1' + - uses: actions/checkout@v2 + - name: M2 Integration Tests with Magento 2 Version 2.4.3-p2 (PHP 7.4) + uses: extdn/github-actions-m2/magento-integration-tests/7.4@master + with: + module_name: CustomGento_CliTaxEditor + composer_name: customgento/module-cli-tax-editor-m2 + ce_version: '2.4.3-p2' + - uses: actions/checkout@v2 + - name: M2 Integration Tests with Magento 2 Version 2.4.4 (PHP 7.4) + uses: extdn/github-actions-m2/magento-integration-tests/7.4@master + with: + module_name: CustomGento_CliTaxEditor + composer_name: customgento/module-cli-tax-editor-m2 + ce_version: '2.4.4' + - uses: actions/checkout@v2 + - name: M2 Integration Tests with Magento 2 Version 2.4.4 (PHP 8.1) + uses: extdn/github-actions-m2/magento-integration-tests/8.1@master + with: + module_name: CustomGento_CliTaxEditor + composer_name: customgento/module-cli-tax-editor-m2 + ce_version: '2.4.4' + composer_version: '2' diff --git a/composer.json b/composer.json index 44cfd60..5cf7a83 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "require": { "magento/framework": "~102.0||~103.0", "magento/module-tax": "~100.3", - "php": "~7.3.0||~7.4.0", + "php": "~7.3.0||~7.4.0||~8.1.0", "symfony/console": "~4.1" }, "require-dev": { From e16f9b72ad7d04c067f9b0bf31228c716064645f Mon Sep 17 00:00:00 2001 From: Petar Date: Wed, 4 May 2022 14:15:13 +0200 Subject: [PATCH 2/2] Update type casting --- Console/Command/Tax/Rates/EditCommand.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Console/Command/Tax/Rates/EditCommand.php b/Console/Command/Tax/Rates/EditCommand.php index fdfcb27..c1b22ad 100644 --- a/Console/Command/Tax/Rates/EditCommand.php +++ b/Console/Command/Tax/Rates/EditCommand.php @@ -109,13 +109,12 @@ private function updateTitlesForTaxRate(TaxRateInterface $taxRate, int $newRate) { // assumption: everyone writes the tax rate without decimal places in their code / title // current shortcut: only integer tax rates are supported - this will not work for decimal tax rates - $oldRate = (int)$taxRate->getRate(); - $newCode = str_replace($oldRate, $newRate, $taxRate->getCode()); + $oldRate = (string)$taxRate->getRate(); + $newCode = str_replace($oldRate, (string)$newRate, $taxRate->getCode()); $taxRate->setCode($newCode); - $titles = $taxRate->getTitles(); - foreach ($titles as $title) { - $newValue = str_replace($oldRate, $newRate, $title->getValue()); + foreach ($taxRate->getTitles() as $title) { + $newValue = str_replace($oldRate, (string)$newRate, $title->getValue()); $title->setValue($newValue); } }