Skip to content

Commit

Permalink
HP-1751 tiny
Browse files Browse the repository at this point in the history
  • Loading branch information
VadymHrechukha committed Jan 6, 2025
1 parent 2a0421b commit 78380f0
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/product/PriceTypeDefinition.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use hiqdev\billing\registry\behavior\PriceTypeDefinitionBehaviourCollection;
use hiqdev\billing\registry\Domain\Model\TariffType;
use hiqdev\billing\registry\Domain\Model\Unit\Unit;
use hiqdev\billing\registry\invoice\InvoiceRepresentationCollection;
use hiqdev\billing\registry\product\Aggregate;
use hiqdev\billing\registry\quantity\formatter\QuantityFormatterDefinition;
Expand All @@ -12,12 +13,10 @@
use hiqdev\billing\registry\Domain\Model\Unit\FractionUnit;
use hiqdev\php\billing\quantity\QuantityFormatterInterface;
use hiqdev\php\billing\type\TypeInterface;
use hiqdev\php\units\Unit;
use hiqdev\php\units\UnitInterface;

class PriceTypeDefinition implements ParentNodeDefinitionInterface
{
private UnitInterface $unit;
private Unit $unit;

Check failure on line 19 in src/product/PriceTypeDefinition.php

View workflow job for this annotation

GitHub Actions / PHP 8.3

UndefinedClass

src/product/PriceTypeDefinition.php:19:13: UndefinedClass: Class, interface or enum named hiqdev\billing\registry\Domain\Model\Unit\Unit does not exist (see https://psalm.dev/019)

private string $description;

Expand Down Expand Up @@ -45,9 +44,9 @@ protected function init(): void
// Hook
}

public function unit(string $unit): self
public function unit(Unit $unit): self
{
$this->unit = Unit::create($unit);
$this->unit = $unit;

return $this;
}
Expand Down Expand Up @@ -81,7 +80,7 @@ public function createQuantityFormatter(
FractionQuantityData $data,
): QuantityFormatterInterface {
return QuantityFormatterFactory::create(
$this->getUnit(),
$this->getUnit()->createExternalUnit(),
$this->quantityFormatterDefinition,
$data,
);
Expand Down Expand Up @@ -113,7 +112,7 @@ public function hasType(TypeInterface $type): bool
return $this->type->equals($type);
}

public function getUnit(): UnitInterface
public function getUnit(): Unit
{
return $this->unit;
}
Expand Down

0 comments on commit 78380f0

Please sign in to comment.