Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "MIT",
"require": {
"php": ">=5.5.0",
"commerceguys/addressing": "^1.0",
"commerceguys/addressing": "^1.0 || ^2.0",
"commerceguys/zone": "^0.8",
"doctrine/collections": "^1.0 || ^2.0"
},
Expand Down
4 changes: 2 additions & 2 deletions src/Model/TaxRate.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function getType()
/**
* {@inheritdoc}
*/
public function setType(TaxTypeEntityInterface $type = null)
public function setType(TaxTypeEntityInterface|null $type = null)
{
$this->type = $type;

Expand Down Expand Up @@ -166,7 +166,7 @@ public function hasAmounts()
/**
* {@inheritdoc}
*/
public function getAmount(\DateTime $date = null)
public function getAmount(\DateTime|null $date = null)
{
if (is_null($date)) {
// Initialize DateTime to the current date.
Expand Down
2 changes: 1 addition & 1 deletion src/Model/TaxRateAmount.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function getRate()
/**
* {@inheritdoc}
*/
public function setRate(TaxRateEntityInterface $rate = null)
public function setRate(TaxRateEntityInterface|null $rate = null)
{
$this->rate = $rate;

Expand Down
2 changes: 1 addition & 1 deletion src/Model/TaxRateAmountEntityInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface TaxRateAmountEntityInterface extends TaxRateAmountInterface
*
* @return self
*/
public function setRate(TaxRateEntityInterface $rate = null);
public function setRate(TaxRateEntityInterface|null $rate = null);

/**
* Sets the tax rate amount id.
Expand Down
2 changes: 1 addition & 1 deletion src/Model/TaxRateEntityInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface TaxRateEntityInterface extends TaxRateInterface
*
* @return self
*/
public function setType(TaxTypeEntityInterface $type = null);
public function setType(TaxTypeEntityInterface|null $type = null);

/**
* Sets the tax rate id.
Expand Down
2 changes: 1 addition & 1 deletion src/Repository/TaxTypeRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class TaxTypeRepository implements TaxTypeRepositoryInterface
* @param string $definitionPath The path to the tax type and zone
* definitions. Defaults to 'resources/'.
*/
public function __construct($definitionPath = null, ZoneRepositoryInterface $zoneRepository = null)
public function __construct(string|null $definitionPath = null, ZoneRepositoryInterface|null $zoneRepository = null)
{
$definitionPath = $definitionPath ?: __DIR__ . '/../../resources/';
$this->definitionPath = $definitionPath . 'tax_type/';
Expand Down
2 changes: 1 addition & 1 deletion src/Resolver/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Context
* @param array $storeRegistrations
* @param \DateTime $date
*/
public function __construct(AddressInterface $customerAddress, AddressInterface $storeAddress, $customerTaxNumber = '', array $storeRegistrations = [], \DateTime $date = null)
public function __construct(AddressInterface $customerAddress, AddressInterface $storeAddress, $customerTaxNumber = '', array $storeRegistrations = [], \DateTime|null $date = null)
{
$this->customerAddress = $customerAddress;
$this->storeAddress = $storeAddress;
Expand Down
3 changes: 3 additions & 0 deletions tests/Resolver/TaxRate/DefaultTaxRateResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
namespace CommerceGuys\Tax\Tests\Resolver;

use CommerceGuys\Tax\Resolver\TaxRate\DefaultTaxRateResolver;
use CommerceGuys\Tax\Resolver\TaxRate\TaxRateResolverInterface;
use PHPUnit\Framework\TestCase;

/**
* @coversDefaultClass \CommerceGuys\Tax\Resolver\TaxRate\DefaultTaxRateResolver
*/
class DefaultTaxRateResolverTest extends TestCase
{

protected TaxRateResolverInterface $resolver;
/**
* {@inheritdoc}
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/Resolver/TaxType/EuTaxTypeResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public function dataProvider()
*
* @return \CommerceGuys\Tax\Resolver\Context
*/
protected function getContext($customerAddress, $storeAddress, $customerTaxNumber = '', $storeRegistrations = [], $date = null)
protected function getContext($customerAddress, $storeAddress, $customerTaxNumber = '', $storeRegistrations = [], \DateTime|null $date = null)
{
$context = $this
->getMockBuilder('CommerceGuys\Tax\Resolver\Context')
Expand Down