-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
StrategyWasRemoved.php
43 lines (34 loc) · 1.03 KB
/
StrategyWasRemoved.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
<?php
declare(strict_types=1);
namespace Pheature\Core\Toggle\Write\Event;
use DateTimeImmutable;
use Pheature\Core\Toggle\Write\FeatureId;
use Pheature\Core\Toggle\Write\StrategyId;
final class StrategyWasRemoved
{
private string $featureId;
private string $strategyId;
private DatetimeImmutable $occurredAt;
public function __construct(string $featureId, string $strategyId, DatetimeImmutable $occurredAt)
{
$this->featureId = $featureId;
$this->strategyId = $strategyId;
$this->occurredAt = $occurredAt;
}
public static function occur(string $featureId, string $strategyId): self
{
return new self($featureId, $strategyId, new DatetimeImmutable());
}
public function featureId(): FeatureId
{
return FeatureId::fromString($this->featureId);
}
public function strategyId(): StrategyId
{
return StrategyId::fromString($this->strategyId);
}
public function occurredAt(): DatetimeImmutable
{
return $this->occurredAt;
}
}