Skip to content
Merged
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
10 changes: 0 additions & 10 deletions src/DataType/Identifier/VatIdentifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,13 @@

namespace Tiime\EN16931\DataType\Identifier;

use Tiime\EN16931\Codelist\CountryAlpha2Code;

readonly class VatIdentifier
{
private string $value;

public function __construct(string $value)
{
$countryCode = substr($value, 0, 2);

if (null === CountryAlpha2Code::tryFrom($countryCode) && $countryCode !== 'EL') {
throw new \Exception('@todo : BR-CO-9');
}

$this->value = $value;

// @todo : Verification for length ? 13 SellerTaxRepresentativeTradeParty / 15 Buyer / 14 Seller (Annexe 1)
}

public function getValue(): string
Expand Down
6 changes: 0 additions & 6 deletions src/SemanticDataType/DecimalNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ public function __construct(
private float $value,
private ?int $decimals = null
) {
if (
$this->decimals !== null
&& !preg_match(sprintf('/^-?\d+(\.\d{1,%s})?$/', $decimals), (string) $value)
) {
throw new \Exception('@todo');
}
}

public function getValue(): float
Expand Down
Loading