/** * @param AggregateType $aggregateType * @param string $aggregateId * @param object $aggregateRoot * @param int $lastVersion * @param DateTimeImmutable $createdAt */ public function __construct(AggregateType $aggregateType, $aggregateId, $aggregateRoot, $lastVersion, DateTimeImmutable $createdAt) { Assertion::minLength($aggregateId, 1); Assertion::isObject($aggregateRoot); Assertion::min($lastVersion, 1); $this->aggregateType = $aggregateType; $this->aggregateId = $aggregateId; $this->aggregateRoot = $aggregateRoot; $this->lastVersion = $lastVersion; $this->createdAt = $createdAt; }
public function testIsObjectExpectingException() { $this->setExpectedException('Assert\\AssertionFailedException', null, Assertion::INVALID_OBJECT); Assertion::isObject('notAnObject'); }
/** * @{inheritdoc} */ public function withMessage($message) { Assertion::isObject($message); return new self($this->messageType, $message, $this->serializedMessage); }