diff --git a/README.md b/README.md index a255d1d..c5636e8 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # AvalaraTax Module [![CI](https://github.com/spryker-eco/avalara-tax/actions/workflows/ci.yml/badge.svg)](https://github.com/spryker-eco/avalara-tax/actions/workflows/ci.yml) [![Latest Stable Version](https://poser.pugx.org/spryker-eco/avalara-tax/v/stable.svg)](https://packagist.org/packages/spryker-eco/avalara-tax) +[![License](https://img.shields.io/github/license/spryker-eco/avalara-tax.svg?b=master)](https://github.com/spryker-eco/avalara-tax) [![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.4-8892BF.svg)](https://php.net/) AvalaraTax module allows the Spryker project to connect to the Avalara tax service. @@ -13,4 +14,4 @@ composer require spryker-eco/avalara-tax ## Documentation -[Spryker Documentation](https://academy.spryker.com/developing_with_spryker/module_guide/modules.html) +[Spryker Documentation](https://docs.spryker.com/docs/scos/user/technology-partners/202108.0/taxes/avalara.html) diff --git a/phpstan.json b/phpstan.json deleted file mode 100644 index 29ea502..0000000 --- a/phpstan.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "defaultLevel": 8 -} diff --git a/phpstan.neon b/phpstan.neon index 3463fc8..050acd2 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,4 +1,7 @@ parameters: + level: 8 + paths: + - src/ checkGenericClassInNonGenericObjectType: false checkMissingIterableValueType: false ignoreErrors: diff --git a/src/SprykerEco/Shared/AvalaraTax/Transfer/avalara_tax.transfer.xml b/src/SprykerEco/Shared/AvalaraTax/Transfer/avalara_tax.transfer.xml index 18041d3..146a471 100644 --- a/src/SprykerEco/Shared/AvalaraTax/Transfer/avalara_tax.transfer.xml +++ b/src/SprykerEco/Shared/AvalaraTax/Transfer/avalara_tax.transfer.xml @@ -181,6 +181,8 @@ + + @@ -274,6 +276,7 @@ + @@ -293,6 +296,7 @@ + diff --git a/src/SprykerEco/Zed/AvalaraTax/Business/Builder/AvalaraTransactionBuilder.php b/src/SprykerEco/Zed/AvalaraTax/Business/Builder/AvalaraTransactionBuilder.php index 48322b6..a6931b5 100644 --- a/src/SprykerEco/Zed/AvalaraTax/Business/Builder/AvalaraTransactionBuilder.php +++ b/src/SprykerEco/Zed/AvalaraTax/Business/Builder/AvalaraTransactionBuilder.php @@ -80,8 +80,8 @@ protected function addTransactionLevelAddress( return $transactionBuilder->withAddress( $avalaraAddressTransfer->getTypeOrFail(), $addressTransfer->getAddress1OrFail(), - $addressTransfer->getAddress2OrFail(), - $addressTransfer->getAddress3() ?? '', + (string)$addressTransfer->getAddress2(), + (string)$addressTransfer->getAddress3(), $addressTransfer->getCityOrFail(), $addressTransfer->getZipCodeOrFail(), $addressTransfer->getIso2CodeOrFail(), @@ -144,7 +144,7 @@ protected function addItemLevelAddress( return $transactionBuilder->withLineAddress( $avalaraAddressTransfer->getTypeOrFail(), $addressTransfer->getAddress1OrFail(), - $addressTransfer->getAddress2OrFail(), + (string)$addressTransfer->getAddress2(), (string)$addressTransfer->getAddress3(), $addressTransfer->getCityOrFail(), $addressTransfer->getZipCodeOrFail(), diff --git a/src/SprykerEco/Zed/AvalaraTax/Business/Calculator/AbstractCartItemAvalaraTaxCalculator.php b/src/SprykerEco/Zed/AvalaraTax/Business/Calculator/AbstractCartItemAvalaraTaxCalculator.php index 6d52cac..b4becad 100644 --- a/src/SprykerEco/Zed/AvalaraTax/Business/Calculator/AbstractCartItemAvalaraTaxCalculator.php +++ b/src/SprykerEco/Zed/AvalaraTax/Business/Calculator/AbstractCartItemAvalaraTaxCalculator.php @@ -128,7 +128,7 @@ protected function resolveAvalaraTransactionType(CalculableObjectTransfer $calcu abstract protected function hasShipmentAddress(CalculableObjectTransfer $calculableObjectTransfer): bool; /** - * @param \Generated\Shared\Transfer\ItemTransfer[]|\ArrayObject $itemTransfers + * @param \ArrayObject<\Generated\Shared\Transfer\ItemTransfer> $itemTransfers * @param \Generated\Shared\Transfer\AvalaraCreateTransactionResponseTransfer $avalaraCreateTransactionResponseTransfer * * @return void diff --git a/src/SprykerEco/Zed/AvalaraTax/Business/Calculator/MultiShipmentCartItemAvalaraTaxCalculator.php b/src/SprykerEco/Zed/AvalaraTax/Business/Calculator/MultiShipmentCartItemAvalaraTaxCalculator.php index c4c6b2e..288fc77 100644 --- a/src/SprykerEco/Zed/AvalaraTax/Business/Calculator/MultiShipmentCartItemAvalaraTaxCalculator.php +++ b/src/SprykerEco/Zed/AvalaraTax/Business/Calculator/MultiShipmentCartItemAvalaraTaxCalculator.php @@ -38,7 +38,7 @@ protected function hasShipmentAddress(CalculableObjectTransfer $calculableObject } /** - * @param \Generated\Shared\Transfer\ItemTransfer[]|\ArrayObject $itemTransfers + * @param \ArrayObject<\Generated\Shared\Transfer\ItemTransfer> $itemTransfers * @param \Generated\Shared\Transfer\AvalaraCreateTransactionResponseTransfer $avalaraCreateTransactionResponseTransfer * * @return void @@ -61,7 +61,7 @@ protected function calculateTaxForItemTransfers( /** * @param \Generated\Shared\Transfer\ItemTransfer $itemTransfer - * @param \Generated\Shared\Transfer\AvalaraTransactionLineTransfer[]|\ArrayObject $avalaraTransactionLineTransfers + * @param \ArrayObject<\Generated\Shared\Transfer\AvalaraTransactionLineTransfer> $avalaraTransactionLineTransfers * @param array $zipCodeRegionNameMap * * @return void @@ -86,7 +86,7 @@ protected function calculateItemTax( /** * @param \Generated\Shared\Transfer\ItemTransfer $itemTransfer - * @param \Generated\Shared\Transfer\AvalaraTransactionLineTransfer[]|\ArrayObject $avalaraTransactionLineTransfers + * @param \ArrayObject<\Generated\Shared\Transfer\AvalaraTransactionLineTransfer> $avalaraTransactionLineTransfers * @param array $zipCodeRegionNameMap * * @return \Generated\Shared\Transfer\AvalaraTransactionLineTransfer|null diff --git a/src/SprykerEco/Zed/AvalaraTax/Business/Calculator/SingleShipmentCartItemAvalaraTaxCalculator.php b/src/SprykerEco/Zed/AvalaraTax/Business/Calculator/SingleShipmentCartItemAvalaraTaxCalculator.php index 61fd20e..75caf67 100644 --- a/src/SprykerEco/Zed/AvalaraTax/Business/Calculator/SingleShipmentCartItemAvalaraTaxCalculator.php +++ b/src/SprykerEco/Zed/AvalaraTax/Business/Calculator/SingleShipmentCartItemAvalaraTaxCalculator.php @@ -29,7 +29,7 @@ protected function hasShipmentAddress(CalculableObjectTransfer $calculableObject } /** - * @param \Generated\Shared\Transfer\ItemTransfer[]|\ArrayObject $itemTransfers + * @param \ArrayObject<\Generated\Shared\Transfer\ItemTransfer> $itemTransfers * @param \Generated\Shared\Transfer\AvalaraCreateTransactionResponseTransfer $avalaraCreateTransactionResponseTransfer * * @return void @@ -48,7 +48,7 @@ protected function calculateTaxForItemTransfers( } /** - * @param \Generated\Shared\Transfer\ItemTransfer[]|\ArrayObject $itemTransfers + * @param \ArrayObject<\Generated\Shared\Transfer\ItemTransfer> $itemTransfers * @param string $groupKey * @param \Generated\Shared\Transfer\AvalaraTransactionLineTransfer $avalaraTransactionLineTransfer * @@ -69,7 +69,7 @@ protected function calculateItemsTaxByGroupKey( } /** - * @param \Generated\Shared\Transfer\AvalaraTransactionLineTransfer[]|\ArrayObject $avalaraTransactionLineTransfers + * @param \ArrayObject<\Generated\Shared\Transfer\AvalaraTransactionLineTransfer> $avalaraTransactionLineTransfers * * @return array<\Generated\Shared\Transfer\AvalaraTransactionLineTransfer> */ diff --git a/src/SprykerEco/Zed/AvalaraTax/Business/Expander/AvalaraTaxCodeExpander.php b/src/SprykerEco/Zed/AvalaraTax/Business/Expander/AvalaraTaxCodeExpander.php index 4daece7..2b76f1a 100644 --- a/src/SprykerEco/Zed/AvalaraTax/Business/Expander/AvalaraTaxCodeExpander.php +++ b/src/SprykerEco/Zed/AvalaraTax/Business/Expander/AvalaraTaxCodeExpander.php @@ -62,7 +62,7 @@ public function expandCartItemsWithAvalaraTaxCode(CartChangeTransfer $cartChange } /** - * @param \Generated\Shared\Transfer\ItemTransfer[]|\ArrayObject $itemTransfers + * @param \ArrayObject<\Generated\Shared\Transfer\ItemTransfer> $itemTransfers * * @return array */