Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Artisan/stubs/value-object.stub
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class {{ class }} extends ValueObject
{
// TODO: Implement validate() method.

if (empty($this->value())) {
if ($this->value() === '') {
throw ValidationException::withMessages(['Value of {{ class }} cannot be empty.']);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Collection/Complex/ClassString.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function value(): string
*/
protected function validate(): void
{
if (empty($this->value())) {
if ($this->value() === '') {
throw ValidationException::withMessages(['Class string cannot be empty.']);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Collection/Complex/FullName.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function toArray(): array
*/
protected function validate(): void
{
if (empty($this->value())) {
if ($this->value() === '') {
throw ValidationException::withMessages(['Full name cannot be empty.']);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Collection/Complex/TaxNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function toArray(): array
*/
protected function validate(): void
{
if (empty($this->value())) {
if ($this->value() === '') {
throw ValidationException::withMessages(['Tax number cannot be empty.']);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Collection/Primitive/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function value(): string
*/
protected function validate(): void
{
if (empty($this->value())) {
if ($this->value() === '') {
throw new InvalidArgumentException('Text cannot be empty.');
}
}
Expand Down