-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModifier.php
51 lines (42 loc) · 1.01 KB
/
Modifier.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/**
* @author enea dhack <enea.so@live.com>
*/
declare(strict_types=1);
namespace Vaened\PriceEngine;
use Brick\Money\Money;
use Vaened\PriceEngine\Adjustments\AdjustmentMode;
use Vaened\PriceEngine\Adjustments\AdjustmentScheme;
use Vaened\PriceEngine\Adjustments\AdjustmentType;
final class Modifier implements AdjustmentScheme
{
public function __construct(
private readonly Money $amount,
private readonly AdjustmentType $type,
private readonly AdjustmentMode $mode,
private readonly int|float $value,
private readonly string $code
)
{
}
public function amount(): Money
{
return $this->amount;
}
public function code(): string
{
return $this->code;
}
public function type(): AdjustmentType
{
return $this->type;
}
public function value(): float|int
{
return $this->value;
}
public function mode(): AdjustmentMode
{
return $this->mode;
}
}