Skip to content

Commit 2bb5310

Browse files
HP-1751 Removed dependency php-billing package from TariffType class
1 parent d9a5ef7 commit 2bb5310

File tree

6 files changed

+20
-12
lines changed

6 files changed

+20
-12
lines changed

src/product/BehaviorCollection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
namespace hiqdev\php\billing\product;
44

5-
use hiqdev\billing\registry\Domain\Model\TariffType;
5+
use hiqdev\php\billing\product\Domain\Model\TariffTypeInterface;
66

77
class BehaviorCollection implements \IteratorAggregate
88
{
99
/** @var BehaviorInterface[] */
1010
private array $behaviors = [];
1111

12-
public function __construct(private readonly TariffType $tariffType)
12+
public function __construct(private readonly TariffTypeInterface $tariffType)
1313
{
1414
}
1515

src/product/BehaviorInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
namespace hiqdev\php\billing\product;
44

5-
use hiqdev\billing\registry\Domain\Model\TariffType;
5+
use hiqdev\php\billing\product\Domain\Model\TariffTypeInterface;
66

77
/**
88
* Empty interface for mark product behavior
99
*/
1010
interface BehaviorInterface
1111
{
12-
public function setTariffType(TariffType $tariffTypeName): void;
12+
public function setTariffType(TariffTypeInterface $tariffTypeName): void;
1313

14-
public function getTariffType(): TariffType;
14+
public function getTariffType(): TariffTypeInterface;
1515
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace hiqdev\php\billing\product\Domain\Model;
4+
5+
interface TariffTypeInterface
6+
{
7+
8+
}

src/product/PriceTypeDefinition.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
namespace hiqdev\php\billing\product;
44

55
use hiqdev\billing\registry\behavior\PriceTypeDefinitionBehaviourCollection;
6-
use hiqdev\billing\registry\Domain\Model\TariffType;
76
use hiqdev\billing\registry\Domain\Model\Unit\Unit;
87
use hiqdev\billing\registry\invoice\InvoiceRepresentationCollection;
98
use hiqdev\billing\registry\product\Aggregate;
109
use hiqdev\billing\registry\quantity\formatter\QuantityFormatterDefinition;
1110
use hiqdev\billing\registry\quantity\formatter\QuantityFormatterFactory;
1211
use hiqdev\billing\registry\quantity\FractionQuantityData;
1312
use hiqdev\billing\registry\Domain\Model\Unit\FractionUnit;
13+
use hiqdev\php\billing\product\Domain\Model\TariffTypeInterface;
1414
use hiqdev\php\billing\quantity\QuantityFormatterInterface;
1515
use hiqdev\php\billing\type\TypeInterface;
1616

@@ -31,7 +31,7 @@ class PriceTypeDefinition implements ParentNodeDefinitionInterface
3131
public function __construct(
3232
private readonly PriceTypeDefinitionCollection $parent,
3333
private readonly TypeInterface $type,
34-
TariffType $tariffType,
34+
TariffTypeInterface $tariffType,
3535
) {
3636
$this->invoiceCollection = new InvoiceRepresentationCollection($this);
3737
$this->behaviorCollection = new PriceTypeDefinitionBehaviourCollection($this, $tariffType);

src/product/PriceTypeDefinitionCollection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace hiqdev\php\billing\product;
44

5-
use hiqdev\billing\registry\Domain\Model\TariffType;
65
use hiqdev\billing\registry\product\GType;
76
use hiqdev\billing\registry\product\PriceType;
87
use hiqdev\billing\registry\product\PriceTypeDefinition\PriceTypeDefinitionFactory;
8+
use hiqdev\php\billing\product\Domain\Model\TariffTypeInterface;
99

1010
class PriceTypeDefinitionCollection implements \IteratorAggregate
1111
{
@@ -52,7 +52,7 @@ private function addPriceTypeDefinition(PriceType $type, PriceTypeDefinition $pr
5252
private function createPriceTypeDefinition(
5353
GType $gType,
5454
PriceType $type,
55-
TariffType $tariffType,
55+
TariffTypeInterface $tariffType,
5656
): PriceTypeDefinition {
5757
return PriceTypeDefinitionFactory::create($this, $type, $gType, $tariffType);
5858
}

src/product/TariffTypeDefinition.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use hiqdev\billing\registry\behavior\TariffTypeBehaviorCollection;
66
use hiqdev\billing\registry\product\Product;
7-
use hiqdev\billing\registry\Domain\Model\TariffType;
7+
use hiqdev\php\billing\product\Domain\Model\TariffTypeInterface;
88

99
class TariffTypeDefinition implements ParentNodeDefinitionInterface
1010
{
@@ -14,13 +14,13 @@ class TariffTypeDefinition implements ParentNodeDefinitionInterface
1414

1515
private TariffTypeBehaviorCollection $behaviorCollection;
1616

17-
public function __construct(private readonly TariffType $tariffType)
17+
public function __construct(private readonly TariffTypeInterface $tariffType)
1818
{
1919
$this->prices = new PriceTypeDefinitionCollection($this);
2020
$this->behaviorCollection = new TariffTypeBehaviorCollection($this, $tariffType);
2121
}
2222

23-
public function tariffType(): TariffType
23+
public function tariffType(): TariffTypeInterface
2424
{
2525
return $this->tariffType;
2626
}

0 commit comments

Comments
 (0)