Skip to content

Commit bca5608

Browse files
committed
Remove the usage of translation helper.
1 parent c98690f commit bca5608

File tree

15 files changed

+17
-17
lines changed

15 files changed

+17
-17
lines changed

src/Artisan/stubs/value-object.stub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class {{ class }} extends ValueObject
6868
// TODO: Implement validate() method.
6969

7070
if (empty($this->value())) {
71-
throw ValidationException::withMessages([__('Value of {{ class }} cannot be empty.')]);
71+
throw ValidationException::withMessages(['Value of {{ class }} cannot be empty.']);
7272
}
7373
}
7474
}

src/Collection/Complex/ClassString.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function value(): string
115115
protected function validate(): void
116116
{
117117
if (empty($this->value())) {
118-
throw ValidationException::withMessages([__('Class string cannot be empty.')]);
118+
throw ValidationException::withMessages(['Class string cannot be empty.']);
119119
}
120120
}
121121
}

src/Collection/Complex/Email.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ protected function validate(): void
9292
);
9393

9494
if ($validator->fails()) {
95-
throw ValidationException::withMessages([__('Your email is invalid.')]);
95+
throw ValidationException::withMessages(['Your email is invalid.']);
9696
}
9797
}
9898

src/Collection/Complex/FullName.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ public function toArray(): array
103103
protected function validate(): void
104104
{
105105
if (empty($this->value())) {
106-
throw ValidationException::withMessages([__('Full name cannot be empty.')]);
106+
throw ValidationException::withMessages(['Full name cannot be empty.']);
107107
}
108108

109109
if (count($this->split) < 2) {
110-
throw ValidationException::withMessages([__('Full name should have a first name and last name.')]);
110+
throw ValidationException::withMessages(['Full name should have a first name and last name.']);
111111
}
112112
}
113113

src/Collection/Complex/Phone.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function sanitized(): string
6363
protected function validate(): void
6464
{
6565
if (! preg_match('/^[+]?[0-9 ]{5,15}$/', $this->sanitized())) {
66-
throw ValidationException::withMessages([__('Your phone number is invalid.')]);
66+
throw ValidationException::withMessages(['Your phone number is invalid.']);
6767
}
6868
}
6969

src/Collection/Complex/TaxNumber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public function toArray(): array
142142
protected function validate(): void
143143
{
144144
if (empty($this->value())) {
145-
throw ValidationException::withMessages([__('Tax number cannot be empty.')]);
145+
throw ValidationException::withMessages(['Tax number cannot be empty.']);
146146
}
147147
}
148148

src/Collection/Complex/Url.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function __construct(string $value)
4949
);
5050

5151
if ($validator->fails()) {
52-
throw ValidationException::withMessages([__('Your URL is invalid.')]);
52+
throw ValidationException::withMessages(['Your URL is invalid.']);
5353
}
5454
}
5555

src/Collection/Complex/Uuid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function toArray(): array
111111
protected function validate(): void
112112
{
113113
if (! str($this->value())->isUuid()) {
114-
throw ValidationException::withMessages([__('UUID is invalid.')]);
114+
throw ValidationException::withMessages(['UUID is invalid.']);
115115
}
116116
}
117117
}

src/ValueObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,6 @@ public function __get(string $name): mixed
159159
*/
160160
public function __set(string $name, mixed $value): void
161161
{
162-
throw new InvalidArgumentException(__(static::IMMUTABLE_MESSAGE));
162+
throw new InvalidArgumentException(static::IMMUTABLE_MESSAGE);
163163
}
164164
}

tests/Unit/Complex/ClassStringTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
try {
1818
new ClassString('');
1919
} catch (ValidationException $e) {
20-
$this->assertSame(__('Class string cannot be empty.'), $e->getMessage());
20+
$this->assertSame('Class string cannot be empty.', $e->getMessage());
2121
}
2222
});
2323

0 commit comments

Comments
 (0)