Skip to content

Commit f55d535

Browse files
Fixed exception
1 parent beeaa0f commit f55d535

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/Model/Domain/Domain.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
namespace Mailgun\Model\Domain;
1313

14+
use DateTimeImmutable;
15+
1416
/**
1517
* Represents domain information in its simplest form.
1618
*
@@ -35,7 +37,8 @@ final class Domain
3537
private bool $isDisabled;
3638

3739
/**
38-
* @throws \DateMalformedStringException
40+
* @param array $data
41+
* @return self
3942
*/
4043
public static function create(array $data): self
4144
{
@@ -46,7 +49,7 @@ public static function create(array $data): self
4649
$model->wildcard = $data['wildcard'] ?? null;
4750
$model->spamAction = $data['spam_action'] ?? null;
4851
$model->state = $data['state'] ?? null;
49-
$model->createdAt = isset($data['created_at']) ? new \DateTimeImmutable($data['created_at']) : null;
52+
$model->createdAt = isset($data['created_at']) ? new DateTimeImmutable($data['created_at']) : null;
5053
$model->webScheme = $data['web_scheme'] ?? null;
5154
$model->webPrefix = $data['web_prefix'] ?? null;
5255
$model->type = $data['type'] ?? 'sandbox';
@@ -108,9 +111,9 @@ public function getState(): ?string
108111
}
109112

110113
/**
111-
* @return \DateTimeImmutable
114+
* @return DateTimeImmutable
112115
*/
113-
public function getCreatedAt(): \DateTimeImmutable
116+
public function getCreatedAt(): DateTimeImmutable
114117
{
115118
return $this->createdAt;
116119
}

0 commit comments

Comments
 (0)