diff --git a/src/Collection/Complex/Email.php b/src/Collection/Complex/Email.php index a7b80f6..c32797d 100644 --- a/src/Collection/Complex/Email.php +++ b/src/Collection/Complex/Email.php @@ -10,7 +10,6 @@ namespace MichaelRubel\ValueObjects\Collection\Complex; -use Illuminate\Support\Collection; use Illuminate\Support\Facades\Validator; use Illuminate\Support\Stringable; use Illuminate\Validation\ValidationException; @@ -33,9 +32,9 @@ class Email extends Text { /** - * @var Collection + * @var array */ - protected Collection $split; + protected array $split; /** * Create a new instance of the value object. @@ -54,7 +53,7 @@ public function __construct(string|Stringable $value) */ public function username(): string { - return $this->split->first(); + return $this->split[0]; } /** @@ -62,7 +61,7 @@ public function username(): string */ public function domain(): string { - return $this->split->last(); + return $this->split[1]; } /** @@ -113,6 +112,6 @@ protected function validationRules(): array */ protected function split(): void { - $this->split = str($this->value())->split('/@/'); + $this->split = explode('@', $this->value()); } }