Skip to content

Commit 85a53f7

Browse files
committed
fix: add exception messages
1 parent 13fbe92 commit 85a53f7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Domain/Value/Link.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ public function __construct(array $values)
6464
$this->uuid = new Uuid($values['uuid']);
6565

6666
Assert::keyExists($values, 'name');
67-
$this->name = TrimmedNonEmptyString::fromString($values['name'])->toString();
67+
$this->name = TrimmedNonEmptyString::fromString($values['name'], 'The value of key "name" must be an trimmed non empty string')->toString();
6868

6969
Assert::keyExists($values, 'slug');
70-
$this->slug = TrimmedNonEmptyString::fromString($values['slug'])->toString();
70+
$this->slug = TrimmedNonEmptyString::fromString($values['slug'], 'The value of key "slug" must be an trimmed non empty string')->toString();
7171

7272
Assert::keyExists($values, 'path');
7373

@@ -78,7 +78,7 @@ public function __construct(array $values)
7878
$this->path = $path ?? null;
7979

8080
Assert::keyExists($values, 'real_path');
81-
$this->realPath = TrimmedNonEmptyString::fromString($values['real_path'])->toString();
81+
$this->realPath = TrimmedNonEmptyString::fromString($values['real_path'], 'The value of key "real_path" must be an trimmed non empty string')->toString();
8282

8383
Assert::keyExists($values, 'position');
8484
Assert::integer($values['position']);

0 commit comments

Comments
 (0)