/** * @param \AGmakonts\DddBricks\Service\ServiceInterface $target * @param array $params */ public function __construct(ServiceInterface $target, array $params = []) { $this->target = $target; $this->occurrenceTime = DateTime::get(); $this->identifier = Text::get(Uuid::uuid4()->toString()); $this->params = $params; }
/** * @covers ::getTimestamp() */ public function testGetTimestamp() { $testClass1 = \AGmakonts\STL\DateTime\DateTime::get(Integer::get(1)); $this->assertInstanceOf(Integer::class, $testClass1->getTimestamp()); $this->assertEquals(1, $testClass1->getTimestamp()->value()); }
/** * @return \AGmakonts\STL\DateTime\DateTime */ public function nextAnniversary() : DateTime { $nativeDate = new \DateTime($this->date()->getTimestamp()->value()); $now = new \DateTime(); $interval = new \DateInterval('P1Y'); while ($nativeDate->getTimestamp() < $now->getTimestamp()) { $nativeDate = $nativeDate->add($interval); } return DateTime::get(Integer::get($nativeDate->getTimestamp())); }
/** * @param \AGmakonts\DddBricks\Entity\EntityInterface $target */ public function __construct(EntityInterface $target) { $this->target = $target; $this->occurrenceTime = DateTime::get(); $this->identifier = Text::get(Uuid::uuid4()->toString()); }