Skip to content

Commit 881679f

Browse files
HP-1751 Removed dependency php-billing package from Unit and FractionUnit classes
1 parent 2bb5310 commit 881679f

File tree

3 files changed

+25
-6
lines changed

3 files changed

+25
-6
lines changed
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\Unit;
4+
5+
interface FractionUnitInterface
6+
{
7+
8+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace hiqdev\php\billing\product\Domain\Model\Unit;
4+
5+
use \hiqdev\php\units\UnitInterface as BaseUnitInterface;
6+
7+
interface UnitInterface
8+
{
9+
public function createExternalUnit(): BaseUnitInterface;
10+
public function fractionUnit(): FractionUnitInterface;
11+
}

src/product/PriceTypeDefinition.php

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

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

1717
class PriceTypeDefinition implements ParentNodeDefinitionInterface
1818
{
19-
private Unit $unit;
19+
private UnitInterface $unit;
2020

2121
private string $description;
2222

@@ -44,7 +44,7 @@ protected function init(): void
4444
// Hook
4545
}
4646

47-
public function unit(Unit $unit): self
47+
public function unit(UnitInterface $unit): self
4848
{
4949
$this->unit = $unit;
5050

@@ -65,7 +65,7 @@ public function getDescription(): string
6565

6666
/**
6767
* @param string $formatterClass
68-
* @param null|FractionUnit|string $fractionUnit
68+
* @param null|FractionUnitInterface|string $fractionUnit
6969
* @return $this
7070
*/
7171
public function quantityFormatter(string $formatterClass, $fractionUnit = null): self
@@ -112,7 +112,7 @@ public function hasType(TypeInterface $type): bool
112112
return $this->type->equals($type);
113113
}
114114

115-
public function getUnit(): Unit
115+
public function getUnit(): UnitInterface
116116
{
117117
return $this->unit;
118118
}

0 commit comments

Comments
 (0)