Files
hedge-fund-ddd-poc/packages/mmt/ddd-shared-kernel/ValueObjects/Price.php
2026-01-06 10:46:49 -05:00

15 lines
299 B
PHP

<?php
namespace MMT\DDDSharedKernel\ValueObjects;
class Price extends ValueObject
{
public function __construct(
private Money $money
)
{
if($this->money->isNegative()) {
throw new \InvalidArgumentException("The price cannot be negative");
}
}
}