public function isValid($value) : bool { if ($value === null && $this->nullable) { return true; } return $value instanceof \DateTimeImmutable; }